Class: BravoModel::Validation::MethodValidator

Inherits:
ActiveModel::EachValidator
  • Object
show all
Defined in:
lib/bravo_model/validation/method_validator.rb

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attr, value) ⇒ Object



3
4
5
6
# File 'lib/bravo_model/validation/method_validator.rb', line 3

def validate_each(record, attr, value)
  method_name = options[:name] || "validate_#{attr}"
  record.send method_name
end