mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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
This commit is contained in:
parent
b4dd1e6879
commit
8945ea9ba2
1 changed files with 2 additions and 1 deletions
|
@ -451,7 +451,8 @@ module ActiveRecord
|
|||
# * <tt>on</tt> - Specifies when this validation is active (default is :save, other options :create, :update)
|
||||
# * <tt>allow_nil</tt> - Skip validation if attribute is nil. (default is true)
|
||||
# * <tt>accept</tt> - 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 <tt>true</tt> before validation.
|
||||
# * <tt>if</tt> - 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.
|
||||
|
|
Loading…
Reference in a new issue