aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-12-02 14:38:33 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-12-02 15:07:00 -0800
commit9f0133fbf4465d97559d97ff04c67775b8379b1c (patch)
treecfab9c8850d45666b1ae21d12e6e7db592220c97 /activerecord
parentae35a36afc616a0225d2f58da125abb318fd9b4a (diff)
downloadrails-9f0133fbf4465d97559d97ff04c67775b8379b1c.tar.gz
rails-9f0133fbf4465d97559d97ff04c67775b8379b1c.tar.bz2
rails-9f0133fbf4465d97559d97ff04c67775b8379b1c.zip
refactor `self.class` to a variable
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/persistence.rb3
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