Module: ActiveModel::Validations::Comparability

Included in:
ComparisonValidator, NumericalityValidator
Defined in:
activemodel/lib/active_model/validations/comparability.rb

Overview

:nodoc:

Constant Summary collapse

COMPARE_CHECKS =
{ greater_than: :>, greater_than_or_equal_to: :>=,
equal_to: :==, less_than: :<, less_than_or_equal_to: :<=,
other_than: :!= }.freeze

Instance Method Summary collapse

Instance Method Details

#error_options(value, option_value) ⇒ Object



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

def error_options(value, option_value)
  options.except(*COMPARE_CHECKS.keys).merge!(
    count: option_value,
    value: value
  )
end