aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorBenjamin Quorning <benjamin@quorning.net>2012-02-22 10:13:27 +0100
committerBenjamin Quorning <benjamin@quorning.net>2012-02-22 10:13:27 +0100
commit5742f12b781ecb212cb746d329e188cb4ff73f70 (patch)
treea2d02a52b655d719fbd9429ba1520edb52b326e8 /activemodel/lib
parent66b7eb19279820b6464ad2b9e3f2efadb08f2ff2 (diff)
downloadrails-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.rb2
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