Class: ActiveModel::Validations::WithValidator
- Inherits:
-
EachValidator
- Object
- ActiveModel::Validator
- EachValidator
- ActiveModel::Validations::WithValidator
- Defined in:
- lib/active_model/validations/with.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from EachValidator
Attributes inherited from ActiveModel::Validator
Instance Method Summary collapse
Methods inherited from EachValidator
#check_validity!, #initialize, #validate
Methods inherited from ActiveModel::Validator
#initialize, kind, #kind, #validate
Constructor Details
This class inherits a constructor from ActiveModel::EachValidator
Instance Method Details
#validate_each(record, attr, val) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/active_model/validations/with.rb', line 8 def validate_each(record, attr, val) method_name = [:with] if record.method(method_name).arity == 0 record.send method_name else record.send method_name, attr end end |