[Bugfix] Confirmed / Unconfirmed events over time for conference dashboard

This commit is contained in:
Chrisbr 2014-07-07 14:58:53 +02:00
parent 609f2fd564
commit d1b038c5a7
9 changed files with 555 additions and 21 deletions

View file

@ -30,6 +30,7 @@ class Event < ActiveRecord::Base
before_create :generate_guid
validate :abstract_limit
validate :before_end_of_conference
validate :biography_exists
validates :title, presence: true
validates :abstract, presence: true
@ -207,4 +208,10 @@ class Event < ActiveRecord::Base
self.week = created_at.strftime('%W')
save!
end
def before_end_of_conference
errors.
add(:created_at, "can't be after the conference end date!") if conference.end_date &&
(Date.today > conference.end_date)
end
end