lib/active_model/validations/numericality.rb in activemodel-3.1.0.beta1 vs lib/active_model/validations/numericality.rb in activemodel-3.1.0.rc1
- old
+ new
@@ -7,13 +7,9 @@
:equal_to => :==, :less_than => :<, :less_than_or_equal_to => :<=,
:odd => :odd?, :even => :even? }.freeze
RESERVED_OPTIONS = CHECKS.keys + [:only_integer]
- def initialize(options)
- super(options.reverse_merge(:only_integer => false, :allow_nil => false))
- end
-
def check_validity!
keys = CHECKS.keys - [:odd, :even]
options.slice(*keys).each do |option, value|
next if value.is_a?(Numeric) || value.is_a?(Proc) || value.is_a?(Symbol)
raise ArgumentError, ":#{option} must be a number, a symbol or a proc"