From f67944e7579711e2c28ea8b48ec739c1ff1966ae Mon Sep 17 00:00:00 2001 From: Denis Jean Date: Wed, 11 Jan 2012 12:45:55 +0100 Subject: 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 --- activerecord/lib/active_record/relation/query_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') 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? -- cgit v1.2.3