diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-25 14:17:57 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-25 14:24:05 -0800 |
commit | 8fc54a2e814b5c85ccfd798285a366347fd6a4e9 (patch) | |
tree | e9c0aaae669967e4cd2a4570f44f18db3c4fe66b /activerecord/lib | |
parent | 2e60b00788fb234a3afe96016c639f7f2ced7115 (diff) | |
download | rails-8fc54a2e814b5c85ccfd798285a366347fd6a4e9.tar.gz rails-8fc54a2e814b5c85ccfd798285a366347fd6a4e9.tar.bz2 rails-8fc54a2e814b5c85ccfd798285a366347fd6a4e9.zip |
only take the limit if there is a limit to take
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index 3c7533ea48..b828cffa77 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -190,7 +190,7 @@ module ActiveRecord end stmt = arel.compile_update(Arel.sql(@klass.send(:sanitize_sql_for_assignment, updates))) - stmt.take limit + stmt.take limit if limit stmt.order(*order) stmt.key = table[primary_key] @klass.connection.update stmt.to_sql |