aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/validations/associated.rb
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2011-07-30 23:16:07 +0530
committerXavier Noria <fxn@hashref.com>2011-08-04 16:41:27 -0700
commit38bfcffc596a6feb822af50bfd3cab93f7cf74a2 (patch)
tree49257b06b46383269d37c565d09b68875070ebad /activerecord/lib/active_record/validations/associated.rb
parentc62cb2f2fbbd7987a4e09e9ffd63b60560785e6f (diff)
downloadrails-38bfcffc596a6feb822af50bfd3cab93f7cf74a2.tar.gz
rails-38bfcffc596a6feb822af50bfd3cab93f7cf74a2.tar.bz2
rails-38bfcffc596a6feb822af50bfd3cab93f7cf74a2.zip
make the warning clear about the effect of using validates_associated on both sides on an association.
Diffstat (limited to 'activerecord/lib/active_record/validations/associated.rb')
-rw-r--r--activerecord/lib/active_record/validations/associated.rb10
1 files changed, 1 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/validations/associated.rb b/activerecord/lib/active_record/validations/associated.rb
index 5df85304a2..7af0352a31 100644
--- a/activerecord/lib/active_record/validations/associated.rb
+++ b/activerecord/lib/active_record/validations/associated.rb
@@ -17,15 +17,7 @@ module ActiveRecord
# validates_associated :pages, :library
# end
#
- # Warning: If, after the above definition, you then wrote:
- #
- # class Page < ActiveRecord::Base
- # belongs_to :book
- #
- # validates_associated :book
- # end
- #
- # this would specify a circular dependency and cause infinite recursion.
+ # WARNING: This validation must not be used on both ends of an association. Doing so will lead to a circular dependency and cause infinite recursion.
#
# NOTE: This validation will not fail if the association hasn't been assigned. If you want to
# ensure that the association is both present and guaranteed to be valid, you also need to