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

block_params: record, attr, value
comment: 
- !ruby/struct:SM::Flow::P 
  body: Validates each attribute against a block.
- !ruby/struct:SM::Flow::VERB 
  body: "  class Person &lt; ActiveRecord::Base\n    validates_each :first_name, :last_name do |record, attr, value|\n      record.errors.add attr, 'starts with z.' if value[0] == ?z\n    end\n  end\n"
- !ruby/struct:SM::Flow::P 
  body: "Options:"
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:on</tt> - Specifies when this validation is active (default is <tt>:save</tt>, other options <tt>:create</tt>, <tt>:update</tt>).
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:allow_nil</tt> - Skip validation if attribute is <tt>nil</tt>.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:allow_blank</tt> - Skip validation if attribute is blank.
  - !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. <tt>:if =&gt; :allow_validation</tt>, or <tt>:if =&gt; Proc.new { |user| user.signup_step &gt; 2 }</tt>). 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. <tt>:unless =&gt; :skip_validation</tt>, or <tt>:unless =&gt; Proc.new { |user| user.signup_step &lt;= 2 }</tt>). The method, proc or string should return or evaluate to a true or false value.
  type: :BULLET
full_name: ActiveRecord::Validations::ClassMethods#validates_each
is_singleton: false
name: validates_each
params: (*attrs) {|record, attr, value| ...}
visibility: public
