Does this work?

  Ad.find(:first, :order => "updated_at DESC")


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of 
Abel
Sent: Friday, October 03, 2008 12:14 PM
To: Ruby on Rails: Talk
Subject: [Rails] Find last record updated


I always get confused when I have to make a search with Active Record a little 
beyond the most ordinaire. How do I find the record that was updated the last?
It has to be something like

Ad.find :conditions => updated_at = :last

I just don't know how to code it.


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

Reply via email to