views for call for booths

This commit is contained in:
nasia 2017-06-26 18:24:32 +03:00
parent 60ec569553
commit 5734c90d1e
9 changed files with 61 additions and 115 deletions

View file

@ -1,10 +1,16 @@
class CallForBooth < ActiveRecord::Base
belongs_to :conference
has_many :booths
validates :start_date, :end_date, :booth_limit, presence: true
validate :before_end_of_conference
validate :start_date_before_end_date
def remaining_days(date = Date.today)
end_date - date > 0 ? (end_date - date) : 0
end
private
def before_end_of_conference