diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-10-07 12:21:52 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-10-07 12:21:52 -0300 |
commit | f13a7bf4e17f265b340ca7d703caeed12716e386 (patch) | |
tree | 92af6ac65fc1ecdc024d582d9c2bb563885263ca /activerecord | |
parent | 942d4b2e4fb6128c3163fb24893e3de9ae73e7c3 (diff) | |
download | rails-f13a7bf4e17f265b340ca7d703caeed12716e386.tar.gz rails-f13a7bf4e17f265b340ca7d703caeed12716e386.tar.bz2 rails-f13a7bf4e17f265b340ca7d703caeed12716e386.zip |
Don't send table_name when updating attributes, use the class arel_table.
Diffstat (limited to 'activerecord')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 4472db28ce..44eaff3aa7 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -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 |