diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-06-13 10:59:11 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-06-13 10:59:11 -0700 |
commit | 634fd040dbabf3e268a6a4bf4a9136468222022f (patch) | |
tree | e11c5c163712352527626319cd51077e3ffa9861 /activerecord/lib/active_record/nested_attributes.rb | |
parent | 9abcb131f94786dbe273088ebd0d93444ca298b2 (diff) | |
download | rails-634fd040dbabf3e268a6a4bf4a9136468222022f.tar.gz rails-634fd040dbabf3e268a6a4bf4a9136468222022f.tar.bz2 rails-634fd040dbabf3e268a6a4bf4a9136468222022f.zip |
let the object stay in charge of internal cache invalidation
Diffstat (limited to 'activerecord/lib/active_record/nested_attributes.rb')
-rw-r--r-- | activerecord/lib/active_record/nested_attributes.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb index 0e8822d63f..e53e8553ad 100644 --- a/activerecord/lib/active_record/nested_attributes.rb +++ b/activerecord/lib/active_record/nested_attributes.rb @@ -306,14 +306,9 @@ module ActiveRecord attr_names.each do |association_name| if reflection = reflect_on_association(association_name) - reflection.options[:autosave] = true + reflection.autosave = true add_autosave_association_callbacks(reflection) - # Clear cached values of any inverse associations found in the - # reflection and prevent the reflection from finding inverses - # automatically in the future. - reflection.remove_automatic_inverse_of! - nested_attributes_options = self.nested_attributes_options.dup nested_attributes_options[association_name.to_sym] = options self.nested_attributes_options = nested_attributes_options |