Model.find(:all, :conditions => [‘created_at < ?’, 1.year.ago]) #
Created
more than 1 year ago
Model.find(:all, :conditions => [‘created_at > ? AND created_at < ?’,
DateTime.new(2006, 3), DateTime.new(2006, 4)]) # Created in March
Model.find(:all, :conditions => [‘created_at < ?’, 1.year.ago]) # Created
more than 1 year ago
Model.find(:all, :conditions => [‘created_at > ? AND created_at < ?’,
DateTime.new(2006, 3), DateTime.new(2006, 4)]) # Created in March
you get the idea…
Yes, I do. That’s not hard at all. Should have been obvious.
Sometimes I surprise myself with how dumb I am. >:(
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.