mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
[Bugfix] Confirmed / Unconfirmed events over time for conference dashboard
This commit is contained in:
parent
609f2fd564
commit
d1b038c5a7
9 changed files with 555 additions and 21 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue