Class: IdValidator

Inherits:
ActiveModel::EachValidator
  • Object
show all
Defined in:
lib/solid/validators/id_validator.rb

Instance Method Summary collapse

Instance Method Details

#validate_each(model, attribute, value) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/solid/validators/id_validator.rb', line 8

def validate_each(model, attribute, value)
  opts = OPTIONS.merge(options.except(*OPTIONS.keys))

  opts[:attributes] = attribute

  ::ActiveModel::Validations::NumericalityValidator.new(opts).validate_each(model, attribute, value)
end