On Mon, Apr 19, 2010 at 9:03 AM, Vladimir Rybas <[email protected]> wrote: > To find the last id of MyModel you could do > MyModel.last.id > even souds like it should ) > But it's not what you really want for upper bound. In your case > MyModel.count(:all) or just MyModel.count > will fit better
? That's not the same. If I have a DB that assigns IDs sequentially, and I've created 5 instances, the last id will be 5. If I subsequently destroy an instance, e.g. id == 1, the last id is still 5, but the count is 4. -- Hassan Schroeder ------------------------ [email protected] twitter: @hassan -- 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.

