diff options
author | Xavier Noria <fxn@hashref.com> | 2016-10-07 18:29:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-07 18:29:33 +0200 |
commit | f94a14d2c265982713248dd742ca75b33f458fb1 (patch) | |
tree | fd5b30c238d563d5711eab6e166c8e05abf97bdd | |
parent | fc0b62597f9c34bd028fd91457b8865eea42cc2d (diff) | |
parent | 13af342c34e04a8e526c4bd11bbe4f5270e7f8fa (diff) | |
download | rails-f94a14d2c265982713248dd742ca75b33f458fb1.tar.gz rails-f94a14d2c265982713248dd742ca75b33f458fb1.tar.bz2 rails-f94a14d2c265982713248dd742ca75b33f458fb1.zip |
Merge pull request #26730 from rails/explain-why-inverse_of-is-disabled
explain why autosave= disables inverse_of [ci skip]
-rw-r--r-- | activerecord/lib/active_record/reflection.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index 9b692f55d2..57020e00c9 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -282,6 +282,10 @@ module ActiveRecord end def autosave=(autosave) + # autosave and inverse_of do not get along together nowadays. They may + # for example cause double saves. Thus, we disable this flag. If in the + # future those two flags are known to work well together, this could be + # removed. @automatic_inverse_of = false @options[:autosave] = autosave parent_reflection = self.parent_reflection |