diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-02 14:38:33 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-02 15:07:00 -0800 |
commit | 9f0133fbf4465d97559d97ff04c67775b8379b1c (patch) | |
tree | cfab9c8850d45666b1ae21d12e6e7db592220c97 | |
parent | ae35a36afc616a0225d2f58da125abb318fd9b4a (diff) | |
download | rails-9f0133fbf4465d97559d97ff04c67775b8379b1c.tar.gz rails-9f0133fbf4465d97559d97ff04c67775b8379b1c.tar.bz2 rails-9f0133fbf4465d97559d97ff04c67775b8379b1c.zip |
refactor `self.class` to a variable
-rw-r--r-- | activerecord/lib/active_record/persistence.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index 75dba0206d..fad83cde09 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -250,7 +250,8 @@ module ActiveRecord 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)).arel.update(attributes_with_values) + klass = self.class + klass.unscoped.where(klass.arel_table[klass.primary_key].eq(id)).arel.update(attributes_with_values) end # Creates a record with values matching those of the instance attributes |