This project is archived and is in readonly mode.

#4096 ✓invalid
ronin-88709 (at lighthouseapp)

Limit failing on Arel Rails 3.0Beta

Reported by ronin-88709 (at lighthouseapp) | March 3rd, 2010 @ 02:33 AM | in 3.0.2

I've been puzzled over this, maybe I misunderstood something about chaining and Arel, it could be an issue.

scenario::

There are 250 comments for this current_user, id=1

@comments= Comment.where("user_id =?, current_user).limit(10)

when performing this with Rails 3.0.0Bet
a, Ruby 1.9.1 I get a result set of 250 and the limit fails
checking the output with to_sql and is seems correct

e.g => "SELECT comments.* FROM comments WHERE (user_id =1) LIMIT 10"

but @comments.count comes up with 250 records.

with

@comments= Comment.find_by_sql("SELECT comments.* FROM comments WHERE (user_id =1) LIMIT 10") I get the expected 10 results...

I've searched all the tickets and cant seem to find any reference to this, I havent forked the latest beta3.0.1, and see no reference to this issue in the commits.

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>

Pages