diff options
author | palkan <dementiev.vm@gmail.com> | 2015-02-01 15:53:44 +0300 |
---|---|---|
committer | palkan <dementiev.vm@gmail.com> | 2015-02-01 15:53:44 +0300 |
commit | ec48e5d6543b4c14f5dd86b6815ce4a30a572d06 (patch) | |
tree | 1f467c89e6846ffe2168548fceaae2e18e112492 /activerecord/lib | |
parent | e374db237198b07e778c41320922d574fef4bc5e (diff) | |
download | rails-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')
-rw-r--r-- | activerecord/lib/active_record/associations.rb | 4 |
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 |