Permalink
Browse files

Merge pull request #5400 from arunagw/issue_4409

Issue 4409
  • Loading branch information...
2 parents 5f26ce6 + f67944e commit a9320f7c0bb27e41dc7c3bacc5084341c6aac2bc @josevalim josevalim committed Mar 13, 2012
@@ -270,7 +270,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?
@@ -1204,6 +1204,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 a9320f7

Please sign in to comment.