aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/validations.rb
diff options
context:
space:
mode:
authorMarcel Molina <marcel@vernix.org>2007-12-13 03:33:54 +0000
committerMarcel Molina <marcel@vernix.org>2007-12-13 03:33:54 +0000
commit8945ea9ba2145ee41c2328361fa6880ae3e99c82 (patch)
tree9a107dd38cacb0492cb0bb806473a8f964fb7de5 /activerecord/lib/active_record/validations.rb
parentb4dd1e6879affc33e4595509fa49f3531759e54d (diff)
downloadrails-8945ea9ba2145ee41c2328361fa6880ae3e99c82.tar.gz
rails-8945ea9ba2145ee41c2328361fa6880ae3e99c82.tar.bz2
rails-8945ea9ba2145ee41c2328361fa6880ae3e99c82.zip
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
Diffstat (limited to 'activerecord/lib/active_record/validations.rb')
-rwxr-xr-xactiverecord/lib/active_record/validations.rb3
1 files changed, 2 insertions, 1 deletions
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
# * <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.