aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2010-01-20 18:40:19 +0530
committerPratik Naik <pratiknaik@gmail.com>2010-01-20 19:01:26 +0530
commit8b9bfbe225a59ccefa46f1e8bf301bc483bef0e0 (patch)
tree023c1c237bf65da35ebaccc3db843587b1052e69 /activerecord/lib/active_record/base.rb
parentf216fadc0e4a54d1807fe5a9462f7bd34e9024b0 (diff)
downloadrails-8b9bfbe225a59ccefa46f1e8bf301bc483bef0e0.tar.gz
rails-8b9bfbe225a59ccefa46f1e8bf301bc483bef0e0.tar.bz2
rails-8b9bfbe225a59ccefa46f1e8bf301bc483bef0e0.zip
Dont delegate Relation#update to arel
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rwxr-xr-xactiverecord/lib/active_record/base.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 1896b49977..45edc3fe60 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -685,7 +685,7 @@ module ActiveRecord #:nodoc:
relation = current_scoped_methods.except(:limit, :order).merge(relation) if current_scoped_methods
end
- relation.update(sanitize_sql_for_assignment(updates))
+ relation.arel.update(sanitize_sql_for_assignment(updates))
end
# Returns the result of an SQL statement that should only include a COUNT(*) in the SELECT part.
@@ -2188,7 +2188,7 @@ module ActiveRecord #:nodoc:
def update(attribute_names = @attributes.keys)
attributes_with_values = arel_attributes_values(false, false, attribute_names)
return 0 if attributes_with_values.empty?
- self.class.unscoped.where(self.class.arel_table[self.class.primary_key].eq(id)).update(attributes_with_values)
+ self.class.unscoped.where(self.class.arel_table[self.class.primary_key].eq(id)).arel.update(attributes_with_values)
end
# Creates a record with values matching those of the instance attributes