views for call for booths
This commit is contained in:
parent
60ec569553
commit
5734c90d1e
9 changed files with 61 additions and 115 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue