diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-12-03 22:41:54 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-12-05 12:44:14 -0200 |
commit | c4809d9984ab5d20759075a96ddea6096ab93802 (patch) | |
tree | dbee813f1dafc04867794a813142fa7eea64615d | |
parent | 3ab98cf6e0d399042424d44a788b8bc679b8dd1c (diff) | |
download | rails-c4809d9984ab5d20759075a96ddea6096ab93802.tar.gz rails-c4809d9984ab5d20759075a96ddea6096ab93802.tar.bz2 rails-c4809d9984ab5d20759075a96ddea6096ab93802.zip |
use map instead of each
-rw-r--r-- | activerecord/lib/active_record/base.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index ba7f6f0129..f54c9d118d 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1500,9 +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 - attrs = {} - attribute_names.each { |name| attrs[name] = read_attribute(name) } - attrs + Hash[attribute_names.map { |name| [name, read_attribute(name)] }] end # Returns an <tt>#inspect</tt>-like string for the value of the |