named_scope :recent, lambda { {:conditions => ['updated_at > ?', 24.hours.ago]} }
On Apr 11, 7:25 pm, Fresh Mix <rails-mailing-l...@andreas-s.net> wrote: > Frederick Cheung wrote: > > On Apr 11, 11:42 am, Fresh Mix <rails-mailing-l...@andreas-s.net> > > wrote: > >> How can I get number of rows that was updated "today"? > > >> Table: messages (id, title, message, updated_at) > > > Decide on your precise definition of today (since midnight, last 24 > > hours etc.) and use ActiveRecord's count method. > > > Fred > > I think that last 24 hours is better > -- > Posted viahttp://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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---