aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-07-02 06:59:08 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-07-02 06:59:08 +0000
commit9ac02777e7fc81369e5a837124aff51a7ca03d2b (patch)
tree9721adcbf76ca435b58479717c743812048a6649 /activerecord/lib/active_record
parenta53372c273a06681c3e4e51faa5b0f7757d35d0b (diff)
downloadrails-9ac02777e7fc81369e5a837124aff51a7ca03d2b.tar.gz
rails-9ac02777e7fc81369e5a837124aff51a7ca03d2b.tar.bz2
rails-9ac02777e7fc81369e5a837124aff51a7ca03d2b.zip
Clarified intentions of validates_associated #870
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1602 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-xactiverecord/lib/active_record/validations.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb
index f455b97e0a..fb207ef4b2 100755
--- a/activerecord/lib/active_record/validations.rb
+++ b/activerecord/lib/active_record/validations.rb
@@ -572,7 +572,10 @@ module ActiveRecord
# validates_associated :book
# end
#
- # this would specify a circular dependency and cause infinite recursion. The Rails team recommends against this practice.
+ # ...this would specify 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 use validates_presence_of.
#
# Configuration options:
# * <tt>on</tt> Specifies when this validation is active (default is :save, other options :create, :update)