aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-12-03 22:45:02 -0200
committerSantiago Pastorino <santiago@wyeworks.com>2010-12-05 12:44:17 -0200
commit20ba81e47d04b0ffd510c4de9c65a439b22a00b2 (patch)
treee1e71b7d1ed878c6cba88850c73e176e8b4a7cba /activerecord/lib/active_record/base.rb
parentc4809d9984ab5d20759075a96ddea6096ab93802 (diff)
downloadrails-20ba81e47d04b0ffd510c4de9c65a439b22a00b2.tar.gz
rails-20ba81e47d04b0ffd510c4de9c65a439b22a00b2.tar.bz2
rails-20ba81e47d04b0ffd510c4de9c65a439b22a00b2.zip
We can use the keys of the @attributes hash here and avoid a method call
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rw-r--r--activerecord/lib/active_record/base.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index f54c9d118d..b55aaddbd7 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1500,7 +1500,7 @@ MSG
# Returns a hash of all the attributes with their names as keys and the values of the attributes as values.
def attributes
- Hash[attribute_names.map { |name| [name, read_attribute(name)] }]
+ Hash[@attributes.map { |name, _| [name, read_attribute(name)] }]
end
# Returns an <tt>#inspect</tt>-like string for the value of the