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
On Sep 17, 2014, at 9:09 AM, Matteo Panara wrote:
> 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:
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
Where did that method come from? All other methods are Ruby methods.
On Wed, Sep 17, 2014 at 3:09 PM, Matteo Panara
wrote:
> Why not?
>
> module ActiveModel
> module Validations
> class NumericalityValidator < EachValidator
> CHECKS = { greater_than: :>, greater_than_or_equal_to: :>=
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: