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 multiple_of isn’t > defined for all of Numeric) > > https://github.com/rails/rails/pull/7213 (on adding this exact feature) > > TL;DR the core of the problem is that % is a tricky operator for > floating-point numbers. 1.0 % 0.1, for instance, is usually NOT 0.0 like > you’d expect… >
It makes sense. Thanks. Matteo -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/d/optout.