aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/nested_attributes.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-10-08 00:14:37 +0100
committerPratik Naik <pratiknaik@gmail.com>2009-10-08 00:15:36 +0100
commit0c27d0886e880f90240ad2004f1600c1b1c4bfed (patch)
tree2950c22f1c5dd6386794334a24af11d2b69087c7 /activerecord/lib/active_record/nested_attributes.rb
parentc352ec060ceddc43f63863c5d16ae31c3a72e42f (diff)
downloadrails-0c27d0886e880f90240ad2004f1600c1b1c4bfed.tar.gz
rails-0c27d0886e880f90240ad2004f1600c1b1c4bfed.tar.bz2
rails-0c27d0886e880f90240ad2004f1600c1b1c4bfed.zip
Use indifferent access attributes instead of stringifying them
Diffstat (limited to 'activerecord/lib/active_record/nested_attributes.rb')
-rw-r--r--activerecord/lib/active_record/nested_attributes.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb
index 654e91bece..ec6c02db38 100644
--- a/activerecord/lib/active_record/nested_attributes.rb
+++ b/activerecord/lib/active_record/nested_attributes.rb
@@ -283,7 +283,7 @@ module ActiveRecord
# <tt>:_destroy</tt> key set to a truthy value, then the existing record
# will be marked for destruction.
def assign_nested_attributes_for_one_to_one_association(association_name, attributes, allow_destroy)
- attributes = attributes.stringify_keys
+ attributes = attributes.with_indifferent_access
if attributes['id'].blank?
unless reject_new_record?(association_name, attributes)
@@ -336,7 +336,7 @@ module ActiveRecord
end
attributes_collection.each do |attributes|
- attributes = attributes.stringify_keys
+ attributes = attributes.with_indifferent_access
if attributes['id'].blank?
unless reject_new_record?(association_name, attributes)