Class: Event
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Event
- Defined in:
- app/models/event.rb
Class Method Summary collapse
-
.find_visible_by_date(to, from) ⇒ Object
visible events that start within ‘to’ days of today, or ended less than ‘from’ days ago.
Class Method Details
.find_visible_by_date(to, from) ⇒ Object
visible events that start within ‘to’ days of today, or ended less than ‘from’ days ago.
9 10 11 |
# File 'app/models/event.rb', line 9 def Event.find_visible_by_date(to, from) Event.find_all_by_visible(true, :conditions => ["begin_event > ? or end_event > ?", DateTime.now + to.to_i.days, DateTime.now - from.to_i.days]) end |