You can do this very easily with a named scope in your model:
named_scope :between, lambda {|start_date, end_date| {:conditions => ["created_at BETWEEN :start AND :end", {:start => start_date, :end => end_date}]}}
You can do this very easily with a named scope in your model:
named_scope :between, lambda {|start_date, end_date| {:conditions => ["created_at BETWEEN :start AND :end", {:start => start_date, :end => end_date}]}}