Skip to content
Browse files

Merge pull request #5401 from arunagw/issue_4409_3-1-stable

Issue 4409 3 1 stable
  • Loading branch information...
2 parents bccffc9 + b1fe2c6 commit cfab2163228ff76cf1e8eec32194bec1e45641e2 @josevalim josevalim committed Mar 13, 2012
View
2 activerecord/lib/active_record/relation/query_methods.rb
@@ -206,7 +206,7 @@ def build_arel
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?
View
4 activerecord/test/cases/finder_test.rb
@@ -1172,6 +1172,10 @@ def test_find_one_message_with_custom_primary_key
end
end
+ def test_finder_with_offset_string
+ assert_nothing_raised(ActiveRecord::StatementInvalid) { Topic.find(:all, :offset => "3") }
+ end
+
protected
def bind(statement, *vars)
if vars.first.is_a?(Hash)

0 comments on commit cfab216

Please sign in to comment.
Something went wrong with that request. Please try again.