diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-09-30 14:38:58 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-09-30 14:38:58 -0700 |
commit | ccd11d58910059f07b28cc518dbdad42cbc8ea0c (patch) | |
tree | a8cf48bfaa9e85439854f89e5cb675df63374740 /activerecord/lib | |
parent | 54c05acdba138f3a7a3d44dfc922b0fe4e4cf554 (diff) | |
parent | 679860400f1c6c542b33e8c80221cc5aca7b5629 (diff) | |
download | rails-ccd11d58910059f07b28cc518dbdad42cbc8ea0c.tar.gz rails-ccd11d58910059f07b28cc518dbdad42cbc8ea0c.tar.bz2 rails-ccd11d58910059f07b28cc518dbdad42cbc8ea0c.zip |
Merge pull request #12413 from arthurnn/inverse_of_on_build
Inverse of on build
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/association.rb | 1 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/collection_association.rb | 1 |
2 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/association.rb b/activerecord/lib/active_record/associations/association.rb index 99f307922e..1e324c7e95 100644 --- a/activerecord/lib/active_record/associations/association.rb +++ b/activerecord/lib/active_record/associations/association.rb @@ -240,6 +240,7 @@ module ActiveRecord skip_assign = [reflection.foreign_key, reflection.type].compact attributes = create_scope.except(*(record.changed - skip_assign)) record.assign_attributes(attributes, :without_protection => true) + set_inverse_instance(record) end end end diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index baddb9852f..c2dd462b5d 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -350,7 +350,6 @@ module ActiveRecord end callback(:after_add, record) - set_inverse_instance(record) record end |