app/models/tramway/event/event.rb in tramway-event-1.8.7 vs app/models/tramway/event/event.rb in tramway-event-1.8.8
- old
+ new
@@ -8,9 +8,10 @@
enumerize :status, default: :common, in: [ :common, :main ]
scope :main_event, -> { where(status: :main) }
scope :actual, -> { where 'end_date > ?', DateTime.now }
+ scope :past, -> { where 'end_date < ?', DateTime.now }
def request_collecting_state
return :not_initialized unless request_collecting_begin_date.present? || request_collecting_end_date.present?
return :will_begin_soon if request_collecting_begin_date > DateTime.now
return :is_over if request_collecting_end_date < DateTime.now