diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-07 16:00:05 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-07 16:27:34 -0800 |
commit | 1e2ab564f9680fe8ac4fbd55c36eb420f46498e6 (patch) | |
tree | 09a1d5f8eb807f06f078b1400834fd45e1b05a91 | |
parent | 63ed6ca9989fbfcd2b323b98e4110c7504b8d3db (diff) | |
download | rails-1e2ab564f9680fe8ac4fbd55c36eb420f46498e6.tar.gz rails-1e2ab564f9680fe8ac4fbd55c36eb420f46498e6.tar.bz2 rails-1e2ab564f9680fe8ac4fbd55c36eb420f46498e6.zip |
fewer funcalls to the cached attributes variable
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/read.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/read.rb b/activerecord/lib/active_record/attribute_methods/read.rb index 506f6e878f..2001b6522d 100644 --- a/activerecord/lib/active_record/attribute_methods/read.rb +++ b/activerecord/lib/active_record/attribute_methods/read.rb @@ -20,7 +20,7 @@ module ActiveRecord # be cached. Usually caching only pays off for attributes with expensive conversion # methods, like time related columns (e.g. +created_at+, +updated_at+). def cache_attributes(*attribute_names) - attribute_names.each {|attr| cached_attributes << attr.to_s} + cached_attributes.merge attribute_names.map { |attr| attr.to_s } end # Returns the attributes which are cached. By default time related columns |