From ec48e5d6543b4c14f5dd86b6815ce4a30a572d06 Mon Sep 17 00:00:00 2001 From: palkan Date: Sun, 1 Feb 2015 15:53:44 +0300 Subject: [ci skip] add note about has_one :through and :dependent --- activerecord/lib/active_record/associations.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/lib/active_record/associations.rb') diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 35bc09bb10..81a42e22f3 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1000,6 +1000,8 @@ module ActiveRecord # callbacks declared either before or after the :dependent option # can affect what it does. # + # Note that :dependent option is ignored for +has_one+ :through associations. + # # === Delete or destroy? # # +has_many+ and +has_and_belongs_to_many+ associations have the methods destroy, @@ -1330,6 +1332,8 @@ module ActiveRecord # * :nullify causes the foreign key to be set to +NULL+. Callbacks are not executed. # * :restrict_with_exception causes an exception to be raised if there is an associated record # * :restrict_with_error causes an error to be added to the owner if there is an associated object + # + # Note that :dependent option is ignored when using :through option. # [:foreign_key] # Specify the foreign key used for the association. By default this is guessed to be the name # of this class in lower-case and "_id" suffixed. So a Person class that makes a +has_one+ association -- cgit v1.2.3