diff options
author | Xavier Noria <fxn@hashref.com> | 2009-11-15 01:22:26 +0100 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-01-02 20:25:15 -0800 |
commit | 7a2554d9a35545ad24937f04c6416df3ed3f26d9 (patch) | |
tree | 6094834f266d975be6e022e779678709fd1f665e /activesupport/lib/active_support/core_ext/integer/multiple.rb | |
parent | 8571aa613f1707401b0fe54c0fa1687604c48e0a (diff) | |
download | rails-7a2554d9a35545ad24937f04c6416df3ed3f26d9.tar.gz rails-7a2554d9a35545ad24937f04c6416df3ed3f26d9.tar.bz2 rails-7a2554d9a35545ad24937f04c6416df3ed3f26d9.zip |
Let Integer#multiple_of? accept zero as argument
[#2982 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activesupport/lib/active_support/core_ext/integer/multiple.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/integer/multiple.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/integer/multiple.rb b/activesupport/lib/active_support/core_ext/integer/multiple.rb index 40bea54c67..8dff217ddc 100644 --- a/activesupport/lib/active_support/core_ext/integer/multiple.rb +++ b/activesupport/lib/active_support/core_ext/integer/multiple.rb @@ -1,6 +1,6 @@ class Integer # Check whether the integer is evenly divisible by the argument. def multiple_of?(number) - self % number == 0 + number != 0 ? self % number == 0 : zero? end end |