From 9f0133fbf4465d97559d97ff04c67775b8379b1c Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 2 Dec 2010 14:38:33 -0800 Subject: refactor `self.class` to a variable --- activerecord/lib/active_record/persistence.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activerecord/lib') 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 -- cgit v1.2.3