Skip to content
Browse files

Performance: Don't reload ARel relation on update.

  • Loading branch information...
1 parent e204f80 commit 53f6c6d24e6fb25a62144c6ef5020cc04a893f56 @miloops miloops committed Aug 27, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/base.rb
View
2 activerecord/lib/active_record/base.rb
@@ -2869,7 +2869,7 @@ def create_or_update
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.arel_table(self.class.table_name, true).conditions(self.class.arel_table[self.class.primary_key].eq(id)).update(attributes_with_values)
+ self.class.arel_table(self.class.table_name).conditions(self.class.arel_table[self.class.primary_key].eq(id)).update(attributes_with_values)
end
# Creates a record with values matching those of the instance attributes

0 comments on commit 53f6c6d

Please sign in to comment.
Something went wrong with that request. Please try again.