Hi,

SearchResults is the model that we are cleaning up, so we do the following  
on login

SearchResults.delete_all(['updated_at < ?', 1.week.ago])

Cheers
Simon

On Fri, 14 Aug 2009 20:15:20 +0800, RVince <rvinc...@hotmail.com> wrote:

>
> Simon, Is there a way to do it all in one sql statement? May I ask how
> you implement this in Ruby/.Rails, say, doing it when something occurs
> (like login/logout?) Thanks Rvince
> >


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to