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
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
How about
Ad.find :first, :order => ‘updated_at DESC’
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.