diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-04-26 13:29:10 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-04-26 13:29:48 +0100 |
commit | 2f0c8c52e66f1a2a3d1c00efc207f227124e96c2 (patch) | |
tree | 820278eb4982fae64062a407e3972b7ff061fb9f /activerecord/lib/active_record/persistence.rb | |
parent | 1606bee64ade812af1ef5b231e41b44bebddd67f (diff) | |
download | rails-2f0c8c52e66f1a2a3d1c00efc207f227124e96c2.tar.gz rails-2f0c8c52e66f1a2a3d1c00efc207f227124e96c2.tar.bz2 rails-2f0c8c52e66f1a2a3d1c00efc207f227124e96c2.zip |
remove deprecate #update_all usage
Diffstat (limited to 'activerecord/lib/active_record/persistence.rb')
-rw-r--r-- | activerecord/lib/active_record/persistence.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index bb504ae90f..12e232a97f 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -178,7 +178,7 @@ module ActiveRecord verify_readonly_attribute(name) raise ActiveRecordError, "can not update on a new record object" unless persisted? raw_write_attribute(name, value) - self.class.update_all({ name => value }, self.class.primary_key => id) == 1 + self.class.where(self.class.primary_key => id).update_all(name => value) == 1 end # Updates the attributes of the model from the passed-in hash and saves the @@ -313,7 +313,7 @@ module ActiveRecord @changed_attributes.except!(*changes.keys) primary_key = self.class.primary_key - self.class.unscoped.update_all(changes, { primary_key => self[primary_key] }) == 1 + self.class.unscoped.where(primary_key => self[primary_key]).update_all(changes) == 1 end end |