Method: ActiveModel::EachValidator#initialize

Defined in:
lib/active_model/validator.rb

#initialize(options) ⇒ EachValidator

Returns a new validator instance. All options will be available via the options reader, however the :attributes option will be removed and instead be made available through the attributes reader.

[View source]

139
140
141
142
143
144
# File 'lib/active_model/validator.rb', line 139

def initialize(options)
  @attributes = Array.wrap(options.delete(:attributes))
  raise ":attributes cannot be blank" if @attributes.empty?
  super
  check_validity!
end