aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/reflection.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-10-07 18:26:45 +0200
committerXavier Noria <fxn@hashref.com>2016-10-07 18:26:45 +0200
commit13af342c34e04a8e526c4bd11bbe4f5270e7f8fa (patch)
tree8dc2df0f7115485fd2ae58434019301d1152e88e /activerecord/lib/active_record/reflection.rb
parent3127e99d6e0d89149dca5c4815474b69012a86b7 (diff)
downloadrails-13af342c34e04a8e526c4bd11bbe4f5270e7f8fa.tar.gz
rails-13af342c34e04a8e526c4bd11bbe4f5270e7f8fa.tar.bz2
rails-13af342c34e04a8e526c4bd11bbe4f5270e7f8fa.zip
explain why autosave= disables inverse_of [ci skip]
Diffstat (limited to 'activerecord/lib/active_record/reflection.rb')
-rw-r--r--activerecord/lib/active_record/reflection.rb4
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