1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

does not validate length of availability if start_at or end_at are blank and already missing

This commit is contained in:
Nicolas Florentin 2016-04-05 09:57:09 +02:00
parent 4a1c67c8d5
commit 5d38f1e3a5

View File

@ -20,7 +20,8 @@ class Availability < ActiveRecord::Base
attr_accessor :is_reserved, :slot_id, :can_modify
validate :length_must_be_1h_minimum
validates :start_at, :end_at, presence: true
validate :length_must_be_1h_minimum, unless: proc { end_at.blank? or start_at.blank? }
validate :should_be_associated
def safe_destroy