aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations.rb
diff options
context:
space:
mode:
authorpalkan <dementiev.vm@gmail.com>2015-02-01 15:53:44 +0300
committerpalkan <dementiev.vm@gmail.com>2015-02-01 15:53:44 +0300
commitec48e5d6543b4c14f5dd86b6815ce4a30a572d06 (patch)
tree1f467c89e6846ffe2168548fceaae2e18e112492 /activerecord/lib/active_record/associations.rb
parente374db237198b07e778c41320922d574fef4bc5e (diff)
downloadrails-ec48e5d6543b4c14f5dd86b6815ce4a30a572d06.tar.gz
rails-ec48e5d6543b4c14f5dd86b6815ce4a30a572d06.tar.bz2
rails-ec48e5d6543b4c14f5dd86b6815ce4a30a572d06.zip
[ci skip] add note about has_one :through and :dependent
Diffstat (limited to 'activerecord/lib/active_record/associations.rb')
-rw-r--r--activerecord/lib/active_record/associations.rb4
1 files changed, 4 insertions, 0 deletions
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 <tt>:dependent</tt> option
# can affect what it does.
#
+ # Note that <tt>:dependent</tt> option is ignored for +has_one+ <tt>:through</tt> associations.
+ #
# === Delete or destroy?
#
# +has_many+ and +has_and_belongs_to_many+ associations have the methods <tt>destroy</tt>,
@@ -1330,6 +1332,8 @@ module ActiveRecord
# * <tt>:nullify</tt> causes the foreign key to be set to +NULL+. Callbacks are not executed.
# * <tt>:restrict_with_exception</tt> causes an exception to be raised if there is an associated record
# * <tt>:restrict_with_error</tt> causes an error to be added to the owner if there is an associated object
+ #
+ # Note that <tt>:dependent</tt> option is ignored when using <tt>:through</tt> 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