From 8fc54a2e814b5c85ccfd798285a366347fd6a4e9 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 25 Feb 2011 14:17:57 -0800 Subject: only take the limit if there is a limit to take --- activerecord/lib/active_record/relation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord') 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 -- cgit v1.2.3