Class: Event

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/event.rb

Class Method Summary collapse

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