clarion/app/models/call_for_participation.rb
2019-04-28 22:02:02 +03:00

27 lines
427 B
Ruby

class CallForParticipation < ActiveRecord::Base
belongs_to :conference
def open!
self.opens_at = Time.now unless opens_at.present?
self.closes_at = nil
save
end
def close!
self.closes_at = Time.now
save
end
def open?
opens_at.present? && (opens_at < Time.now)
end
def closed?
closes_at.present? && (closes_at < Time.now)
end
def in_progress?
open? && !closed?
end
end