clarion/app/models/call_for_participation.rb

27 lines
427 B
Ruby
Raw Permalink Normal View History

2015-04-20 18:55:06 +03:00
class CallForParticipation < ActiveRecord::Base
belongs_to :conference
def open!
2019-04-28 21:10:54 +03:00
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?
2019-04-28 21:10:54 +03:00
opens_at.present? && (opens_at < Time.now)
end
def closed?
2019-04-28 21:10:54 +03:00
closes_at.present? && (closes_at < Time.now)
end
def in_progress?
2019-04-28 21:10:54 +03:00
open? && !closed?
end
2015-04-20 18:55:06 +03:00
end