--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: "Encapsulates the pattern of wanting to validate the acceptance of a terms of service check box (or similar agreement). Example:"
- !ruby/struct:SM::Flow::VERB 
  body: "  class Person &lt; ActiveRecord::Base\n    validates_acceptance_of :terms_of_service\n    validates_acceptance_of :eula, :message =&gt; &quot;must be abided&quot;\n  end\n"
- !ruby/struct:SM::Flow::P 
  body: If the database column does not exist, the terms_of_service attribute is entirely virtual. This check is performed only if terms_of_service is not nil and by default on save.
- !ruby/struct:SM::Flow::P 
  body: "Configuration options:"
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "<tt>message</tt> - A custom error message (default is: &quot;must be accepted&quot;)"
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>on</tt> - Specifies when this validation is active (default is :save, other options :create, :update)
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>allow_nil</tt> - Skip validation if attribute is nil. (default is true)
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>accept</tt> - Specifies value that is considered accepted. The default value is a string &quot;1&quot;, which 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 &quot;1&quot; to <tt>true</tt> before validation.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>if</tt> - Specifies a method, proc or string to call to determine if the validation should occur (e.g. :if =&gt; :allow_validation, or :if =&gt; Proc.new { |user| user.signup_step &gt; 2 }). The method, proc or string should return or evaluate to a true or false value.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>unless</tt> - Specifies a method, proc or string to call to determine if the validation should not occur (e.g. :unless =&gt; :skip_validation, or :unless =&gt; Proc.new { |user| user.signup_step &lt;= 2 }). The method, proc or string should return or evaluate to a true or false value.
  type: :BULLET
full_name: ActiveRecord::Validations::ClassMethods#validates_acceptance_of
is_singleton: false
name: validates_acceptance_of
params: (*attr_names)
visibility: public
