diff options
author | José Valim <jose.valim@gmail.com> | 2012-02-22 01:27:20 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-02-22 01:27:20 -0800 |
commit | a95f730ea45f01744702849fc084b4d28c857964 (patch) | |
tree | a2d02a52b655d719fbd9429ba1520edb52b326e8 /activemodel | |
parent | 66b7eb19279820b6464ad2b9e3f2efadb08f2ff2 (diff) | |
parent | 5742f12b781ecb212cb746d329e188cb4ff73f70 (diff) | |
download | rails-a95f730ea45f01744702849fc084b4d28c857964.tar.gz rails-a95f730ea45f01744702849fc084b4d28c857964.tar.bz2 rails-a95f730ea45f01744702849fc084b4d28c857964.zip |
Merge pull request #5124 from bquorning/prefer-||-over-'or'-for-boolean-operations
Prefer || over 'or' for boolean operations
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/lib/active_model/validations/length.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/validations/length.rb b/activemodel/lib/active_model/validations/length.rb index f1beddf6d4..037f8c2db8 100644 --- a/activemodel/lib/active_model/validations/length.rb +++ b/activemodel/lib/active_model/validations/length.rb @@ -27,7 +27,7 @@ module ActiveModel keys.each do |key| value = options[key] - unless value.is_a?(Integer) && value >= 0 or value == Float::INFINITY + unless (value.is_a?(Integer) && value >= 0) || value == Float::INFINITY raise ArgumentError, ":#{key} must be a nonnegative Integer or Infinity" end end |