diff options
author | Benjamin Quorning <benjamin@quorning.net> | 2012-02-22 10:13:27 +0100 |
---|---|---|
committer | Benjamin Quorning <benjamin@quorning.net> | 2012-02-22 10:13:27 +0100 |
commit | 5742f12b781ecb212cb746d329e188cb4ff73f70 (patch) | |
tree | a2d02a52b655d719fbd9429ba1520edb52b326e8 /activemodel/lib | |
parent | 66b7eb19279820b6464ad2b9e3f2efadb08f2ff2 (diff) | |
download | rails-5742f12b781ecb212cb746d329e188cb4ff73f70.tar.gz rails-5742f12b781ecb212cb746d329e188cb4ff73f70.tar.bz2 rails-5742f12b781ecb212cb746d329e188cb4ff73f70.zip |
Prefer || over 'or' for boolean operations
Diffstat (limited to 'activemodel/lib')
-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 |