Module: ActiveModel::Validations::Clusivity

Included in:
ExclusionValidator, InclusionValidator
Defined in:
activemodel/lib/active_model/validations/clusivity.rb

Overview

:nodoc:

Constant Summary collapse

ERROR_MESSAGE =
"An object with the method #include? or a proc, lambda or symbol is required, " \
"and must be supplied as the :in (or :within) option of the configuration hash"

Instance Method Summary collapse

Instance Method Details

#check_validity!Object



11
12
13
14
15
# File 'activemodel/lib/active_model/validations/clusivity.rb', line 11

def check_validity!
  unless delimiter.respond_to?(:include?) || delimiter.respond_to?(:call) || delimiter.respond_to?(:to_sym)
    raise ArgumentError, ERROR_MESSAGE
  end
end