aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-02-09 08:24:35 +0000
committerMichael Koziarski <michael@koziarski.com>2008-02-09 08:24:35 +0000
commit3df052ac601186fb9f4b40a33c56b50524402249 (patch)
tree64604dd13b3f79dcab5da1ad623f9a61073a227a /activerecord
parentcadb087deb76e477d5bf557bd3ca67c569095706 (diff)
downloadrails-3df052ac601186fb9f4b40a33c56b50524402249.tar.gz
rails-3df052ac601186fb9f4b40a33c56b50524402249.tar.bz2
rails-3df052ac601186fb9f4b40a33c56b50524402249.zip
Remove misleading / incorrect warning from validation documentation. Closes #8241 [quixoten, pedz, tom]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8825 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rwxr-xr-xactiverecord/lib/active_record/validations.rb11
1 files changed, 0 insertions, 11 deletions
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb
index c49684dceb..5824cd8b6f 100755
--- a/activerecord/lib/active_record/validations.rb
+++ b/activerecord/lib/active_record/validations.rb
@@ -477,17 +477,6 @@ module ActiveRecord
# not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }). The
# method, proc or string should return or evaluate to a true or false value.
#
- # === Warning
- # Validate the presence of the foreign key, not the instance variable itself.
- # Do this:
- # validates_presence_of :invoice_id
- #
- # Not this:
- # validates_presence_of :invoice
- #
- # If you validate the presence of the associated object, you will get
- # failures on saves when both the parent object and the child object are
- # new.
def validates_presence_of(*attr_names)
configuration = { :message => ActiveRecord::Errors.default_error_messages[:blank], :on => :save }
configuration.update(attr_names.extract_options!)