diff options
author | Denis Jean <denis.jean@ecairn.com> | 2012-01-11 12:45:55 +0100 |
---|---|---|
committer | Arun Agrawal <arunagw@gmail.com> | 2012-03-13 08:52:45 +0530 |
commit | f67944e7579711e2c28ea8b48ec739c1ff1966ae (patch) | |
tree | 800057ac2562ad0abe8d800cdb98e20d978e9249 /activerecord/lib | |
parent | 5f26ce699f9e695c434cbff20626a9ff4d3114e4 (diff) | |
download | rails-f67944e7579711e2c28ea8b48ec739c1ff1966ae.tar.gz rails-f67944e7579711e2c28ea8b48ec739c1ff1966ae.tar.bz2 rails-f67944e7579711e2c28ea8b48ec739c1ff1966ae.zip |
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
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index fab2cd77f0..f5bfa3603a 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -270,7 +270,7 @@ module ActiveRecord arel.having(*@having_values.uniq.reject{|h| h.blank?}) unless @having_values.empty? arel.take(connection.sanitize_limit(@limit_value)) if @limit_value - arel.skip(@offset_value) if @offset_value + arel.skip(@offset_value.to_i) if @offset_value arel.group(*@group_values.uniq.reject{|g| g.blank?}) unless @group_values.empty? |