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?
just use the :limit attribute
users=User.find(:all,:order=>“created_at DESC,id”, :limit => 10)
Thorsten M. wrote:
just use the :limit attribute
users=User.find(:all,:order=>“created_at DESC,id”, :limit => 10)
Thank you,i misunderstand the :order param.