You can also create a named_scope in your Model and call it from a
method:
named_scope :compiled_this_week, lambda { { :conditions => ['compiled_on
> ? and compiled_on < ?', Time.now.beginning_of_week,
Time.now.end_of_week] } }
compiled_on is just a field for when the date was compiled_on - you can
use created_at, etc. for substitution.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---