Il giorno mercoledì 17 settembre 2014 17:44:31 UTC+2, Matt jones ha scritto:
>
> multiple_of isn’t a supported option for NumericalityValidator because the
> method only exists for integers. Here’s some previous discussion of this
> situation:
>
> https://github.com/rails/rails/pull/7216 (on why
Il giorno mercoledì 17 settembre 2014 16:33:31 UTC+2, Mohamed Wael
Khobalatte ha scritto:
>
> Where did that method come from? All other methods are Ruby methods.
>
Sorry, I've seen only now that it is an ActiveSupport extension of Integer.
# File activesupport/lib/active_support/core_ext/intege
Why not?
module ActiveModel
module Validations
class NumericalityValidator < EachValidator
CHECKS = { greater_than: :>, greater_than_or_equal_to: :>=,
equal_to: :==, less_than: :<, less_than_or_equal_to: :<=,
multiple_of: :multiple_of?, odd: :odd?, even: