# About find the newly created users

**URL:** <https://www.ruby-forum.com/t/about-find-the-newly-created-users/142402>\
**Category:** Rails\
**Created:** [July 7, 2008, 4:57pm UTC](https://www.ruby-forum.com/t/about-find-the-newly-created-users/142402 "2008-07-07T16:57:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![daociyiyou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/0ea827/32.png) [@daociyiyou](https://www.ruby-forum.com/u/daociyiyou)\
**Post date:** [July 7, 2008, 4:57pm UTC](https://www.ruby-forum.com/t/about-find-the-newly-created-users/142402/1 "2008-07-07T16:57:57Z")

</div>

hello:  
How do i find the newly created 10 users in the database?Now i only  
know the way:  
1.users=User.find(:all,:order=\>“created\_at DESC,id”)  
2.then get the first 10 users from the array  
I think this way is not the best one for getting all the records  
everytime.  
Anyone can help me?

---

<div class="post-metadata">

**Author:** ![daociyiyou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/0ea827/32.png) [@daociyiyou](https://www.ruby-forum.com/u/daociyiyou)\
**Post date:** [July 7, 2008, 8:41pm UTC](https://www.ruby-forum.com/t/about-find-the-newly-created-users/142402/2 "2008-07-07T20:41:00Z")

</div>

Guo Y. wrote:

> hello:  
> How do i find the newly created 10 users in the database?Now i only  
> know the way:  
> 1.users=User.find(:all,:order=\>“created\_at DESC,id”)  
> 2.then get the first 10 users from the array  
> I think this way is not the best one for getting all the records  
> everytime.  
> Anyone can help me?

User.find :all, :order =\> 'created\_at desc", :limit =\> 10
