Permalink
Browse files

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
  • Loading branch information...
1 parent cadb087 commit 3df052ac601186fb9f4b40a33c56b50524402249 @NZKoz NZKoz committed Feb 9, 2008
Showing with 0 additions and 11 deletions.
  1. +0 −11 activerecord/lib/active_record/validations.rb
@@ -477,17 +477,6 @@ def validates_acceptance_of(*attr_names)
# 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!)

0 comments on commit 3df052a

Please sign in to comment.