aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-06-21 13:09:48 -0600
committerSean Griffin <sean@thoughtbot.com>2014-06-21 13:09:48 -0600
commit3e422e201de47c6158d2f60679604e51d2539dfb (patch)
tree7dc0dfe2c8687876e7dd4a4250279d2c502cee65 /activerecord/lib/active_record/attribute_methods.rb
parent0e9a7059664eb9dee8e3afae60d26ff858d0d84b (diff)
downloadrails-3e422e201de47c6158d2f60679604e51d2539dfb.tar.gz
rails-3e422e201de47c6158d2f60679604e51d2539dfb.tar.bz2
rails-3e422e201de47c6158d2f60679604e51d2539dfb.zip
Move `attributes` to the `AttributeSet` object.
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods.rb')
-rw-r--r--activerecord/lib/active_record/attribute_methods.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb
index 268cec6160..267377cec6 100644
--- a/activerecord/lib/active_record/attribute_methods.rb
+++ b/activerecord/lib/active_record/attribute_methods.rb
@@ -271,9 +271,7 @@ module ActiveRecord
# person.attributes
# # => {"id"=>3, "created_at"=>Sun, 21 Oct 2012 04:53:04, "updated_at"=>Sun, 21 Oct 2012 04:53:04, "name"=>"Francesco", "age"=>22}
def attributes
- attribute_names.each_with_object({}) { |name, attrs|
- attrs[name] = read_attribute(name)
- }
+ @attributes.to_hash
end
# Returns an <tt>#inspect</tt>-like string for the value of the