aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/autosave_association.rb
diff options
context:
space:
mode:
authorGordon Chan <developer.gordon+github@gmail.com>2014-07-31 19:14:12 +1200
committerGordon Chan <developer.gordon+github@gmail.com>2014-07-31 19:14:12 +1200
commit6e574e8a11635ec4e579e5b247f6492b9bdc9279 (patch)
treeb4d5510de9a3ee5632e09ae961bafd66fe6592fb /activerecord/lib/active_record/autosave_association.rb
parent29a6a17a11cd98f18ad46e882cc8f7fd669de59f (diff)
downloadrails-6e574e8a11635ec4e579e5b247f6492b9bdc9279.tar.gz
rails-6e574e8a11635ec4e579e5b247f6492b9bdc9279.tar.bz2
rails-6e574e8a11635ec4e579e5b247f6492b9bdc9279.zip
`HashWithIndifferentAccess.new` respects the default value or proc on objects that respond to `#to_hash`.
Builds on the work of #12550 where `.new` will convert the object (that respond to `#to_hash`) to a hash and add that hash's keys and values to itself. This change will also make `.new` respect the default value or proc of objects that respond to `#to_hash`. In other words, this `.new` behaves exactly like `.new_from_hash_copying_default`. `.new_from_hash_copying_default` now simply invokes `.new` and any references to `.new_from_hash_copying_default` are replaced with `.new`. Added tests confirm behavior.
Diffstat (limited to 'activerecord/lib/active_record/autosave_association.rb')
0 files changed, 0 insertions, 0 deletions