mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Don't send table_name when updating attributes, use the class arel_table.
This commit is contained in:
parent
942d4b2e4f
commit
f13a7bf4e1
1 changed files with 1 additions and 1 deletions
|
@ -2868,7 +2868,7 @@ module ActiveRecord #:nodoc:
|
|||
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).conditions(self.class.arel_table[self.class.primary_key].eq(id)).update(attributes_with_values)
|
||||
self.class.arel_table.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
|
||||
|
|
Loading…
Reference in a new issue