Class: ActiveModel::Validations::AssociatedValidator
- Inherits:
-
EachValidator
- Object
- EachValidator
- ActiveModel::Validations::AssociatedValidator
- Defined in:
- lib/two_factor_auth.rb
Overview
:nodoc:
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
108 109 110 111 112 |
# File 'lib/two_factor_auth.rb', line 108 def validate_each(record, attribute, value) if Array.wrap(value).reject {|r| r.valid?}.any? record.errors.add(attribute, value.errors..join("; "), .merge(:value => value)) end end |