Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- named_scope :newest_first, :order => "start_at desc"
- named_scope :ending_first, :order => "end_at"
- named_scope :past_day, :conditions => ["start_at >= ? AND start_at <= ?", Time.now - 1.day, Time.now]
- named_scope :does_expire, :conditions => { :does_not_expire => false}
- named_scope :never_expire, :conditions => { :does_not_expire => true}
- named_scope :active1, :conditions => { :status => true }
- named_scope :started, :conditions => ["start_at <= ? OR start_at IS NULL", Time.now]
- named_scope :not_ended, :conditions => ["end_at >= ? OR end_at IS NULL", Time.now]
- named_scope :ending, :conditions => ["end_at >= ? AND end_at <= ?", Time.now, Time.now + 7.days]
Add Comment
Please, Sign In to add comment