Class: ActiveModel::Validations::FiltersValidator

Inherits:
EachValidator
  • Object
show all
Defined in:
lib/active_model/validations/filters_validator.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ FiltersValidator

Returns a new instance of FiltersValidator.



6
7
8
9
10
11
# File 'lib/active_model/validations/filters_validator.rb', line 6

def initialize(options)
  filters = options.slice(*AttrFilters::Filters::LIST.keys)
  model_class = options[:class]
  model_class.filters(*options[:attributes], filters)
  super(options)
end

Instance Method Details

#validate_each(_record, _attribute, _value) ⇒ Object



13
# File 'lib/active_model/validations/filters_validator.rb', line 13

def validate_each(_record, _attribute, _value); end