Method: ActiveModel::EachValidator#initialize
- Defined in:
- lib/active_model/validator.rb
permalink #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.
139 140 141 142 143 144 |
# File 'lib/active_model/validator.rb', line 139 def initialize() @attributes = Array.wrap(.delete(:attributes)) raise ":attributes cannot be blank" if @attributes.empty? super check_validity! end |