method
validates_with
v3.2.8 -
Show latest stable
- Class:
ActiveModel::Validations::ClassMethods
validates_with(*args, &block)public
If you pass any additional configuration options, they will be passed to the class and available as options:
class Person include ActiveModel::Validations validates_with MyValidator, :my_custom_key => "my custom value" end class MyValidator < ActiveModel::Validator def validate(record) options[:my_custom_key] # => "my custom value" end end