This project is archived and is in readonly mode.

#4882 ✓resolved
James Harton

ActiveRelation bug; size() returning incorrect value with limit().

Reported by James Harton | June 17th, 2010 @ 01:34 AM

Easiest to explain with a snippet:

Loading development environment (Rails 3.0.0.beta4)
ruby-1.8.7-p249 > Post.limit(20).size
 => 1000 
ruby-1.8.7-p249 > Post.limit(20).all.size
 => 20

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Referenced by

Pages