From 20ba81e47d04b0ffd510c4de9c65a439b22a00b2 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Fri, 3 Dec 2010 22:45:02 -0200 Subject: We can use the keys of the @attributes hash here and avoid a method call --- activerecord/lib/active_record/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord') 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 #inspect-like string for the value of the -- cgit v1.2.3