fix activerecord query_method regression with offset into Fixnum #5390

Merged
merged 1 commit into from Mar 12, 2012

Conversation

Projects
None yet
4 participants
Member

arunagw commented Mar 12, 2012

add test to show offset query_methods on mysql & mysql2

change test to cover public API

See PR #4410

@denisj @arunagw denisj fix activerecord query_method regression with offset into Fixnum
add test to show offset query_methods on mysql & mysql2

change test to cover public API
a2c2f40

@josevalim josevalim added a commit that referenced this pull request Mar 12, 2012

@josevalim josevalim Merge pull request #5390 from arunagw/picked_commits
fix activerecord query_method regression with offset into Fixnum
1e2de2c

@josevalim josevalim merged commit 1e2de2c into rails:master Mar 12, 2012

Contributor

metaskills commented on a2c2f40 Apr 13, 2012

@tenderlove Can you look at this. I feel like we keep going back and forth with calling #to_i on offset values. I have a test in the SQL Server adapter that is now failing where we were testing to make sure SQL literals could be use for an offset, like so.

Book.all :limit => 3, :offset => Arel.sql('SELECT 8 AS [count]')

I found this commit via #4409 and would have thought there were test in AR for it to allow order to not just be munged by calling #to_i on it.

Contributor

metaskills replied Apr 13, 2012

I can confirm that the above test worked in ActiveRecord 3.2.2 and the regression was introduced in 3.2.3.

Contributor

metaskills replied Apr 13, 2012

FYI, there is a test named test_limit_should_allow_sql_literal for limit to accept a literal. Not sure what happened to the offset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment