Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8379

Show
Ignore:
Timestamp:
12/13/07 03:33:54 (10 months ago)
Author:
marcel
Message:

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]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/lib/active_record/validations.rb

    r8377 r8379  
    452452      # * <tt>allow_nil</tt> - Skip validation if attribute is nil. (default is true) 
    453453      # * <tt>accept</tt> - Specifies value that is considered accepted.  The default value is a string "1", which 
    454       #   makes it easy to relate to an HTML checkbox. 
     454      #   makes it easy to relate to an HTML checkbox. This should be set to 'true' if you are validating a database 
     455      #   column, since the attribute is typecast from "1" to <tt>true</tt> before validation. 
    455456      # * <tt>if</tt> - Specifies a method, proc or string to call to determine if the validation should 
    456457      #   occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }).  The