From 8945ea9ba2145ee41c2328361fa6880ae3e99c82 Mon Sep 17 00:00:00 2001 From: Marcel Molina Date: Thu, 13 Dec 2007 03:33:54 +0000 Subject: [PATCH] Document what to pass the :accept option for validates_acceptance_of when mapping the attribute to an actual column (rather than a virtual one). Closes #10491 [xaviershay] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8379 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/validations.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index 8c9ff437d7..f1dbe7faee 100755 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -451,7 +451,8 @@ module ActiveRecord # * on - Specifies when this validation is active (default is :save, other options :create, :update) # * allow_nil - Skip validation if attribute is nil. (default is true) # * accept - Specifies value that is considered accepted. The default value is a string "1", which - # makes it easy to relate to an HTML checkbox. + # makes it easy to relate to an HTML checkbox. This should be set to 'true' if you are validating a database + # column, since the attribute is typecast from "1" to true before validation. # * if - Specifies a method, proc or string to call to determine if the validation should # occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The # method, proc or string should return or evaluate to a true or false value.