diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-06-07 09:55:28 -0600 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-06-07 09:55:28 -0600 |
commit | e1f33110e8917eab62614f3ffca4559c62e92ed7 (patch) | |
tree | c1a0d472da9293f40ae44662c5cefd53939e0298 /activerecord/lib/active_record/persistence.rb | |
parent | 2f5fab8d5af6dfe59e73fcf3d8d9902715b4284b (diff) | |
download | rails-e1f33110e8917eab62614f3ffca4559c62e92ed7.tar.gz rails-e1f33110e8917eab62614f3ffca4559c62e92ed7.tar.bz2 rails-e1f33110e8917eab62614f3ffca4559c62e92ed7.zip |
Remove duplicated `@raw_attributes.keys`
Reduces the number of things outside of attribute methods that cares
about the details of how we store and type cast attributes
Diffstat (limited to 'activerecord/lib/active_record/persistence.rb')
-rw-r--r-- | activerecord/lib/active_record/persistence.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index f1f0d3e57f..525289c270 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -494,7 +494,7 @@ module ActiveRecord # Updates the associated record with values matching those of the instance attributes. # Returns the number of affected rows. - def _update_record(attribute_names = @raw_attributes.keys) + def _update_record(attribute_names = self.attribute_names) attributes_values = arel_attributes_with_values_for_update(attribute_names) if attributes_values.empty? 0 @@ -505,7 +505,7 @@ module ActiveRecord # Creates a record with values matching those of the instance attributes # and returns its id. - def _create_record(attribute_names = @raw_attributes.keys) + def _create_record(attribute_names = self.attribute_names) attributes_values = arel_attributes_with_values_for_create(attribute_names) new_id = self.class.unscoped.insert attributes_values |