ActiveModel::Validator
class ActiveModel::Validator
Active Model Validator
A simple base class that can be used along with ActiveModel::Validations::ClassMethods#validates_with
class Person include ActiveModel::Validations validates_with MyValidator end class MyValidator < ActiveModel::Validator def validate(record) if some_complex_logic record.errors.add(:base, "This record is invalid") end end private def some_complex_logic # ... end end
Any class that inherits from ActiveModel::Val