# Find last record updated

**URL:** <https://www.ruby-forum.com/t/find-last-record-updated/150109>\
**Category:** Rails\
**Created:** [October 3, 2008, 9:14pm UTC](https://www.ruby-forum.com/t/find-last-record-updated/150109 "2008-10-03T21:14:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@Abel](https://www.ruby-forum.com/u/Abel)\
**Post date:** [October 3, 2008, 9:14pm UTC](https://www.ruby-forum.com/t/find-last-record-updated/150109/1 "2008-10-03T21:14:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Abel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@Abel](https://www.ruby-forum.com/u/Abel)\
**Post date:** [October 5, 2008, 10:24am UTC](https://www.ruby-forum.com/t/find-last-record-updated/150109/2 "2008-10-05T10:24:52Z")

</div>

Abel wrote:

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