aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-02-22 01:27:20 -0800
committerJosé Valim <jose.valim@gmail.com>2012-02-22 01:27:20 -0800
commita95f730ea45f01744702849fc084b4d28c857964 (patch)
treea2d02a52b655d719fbd9429ba1520edb52b326e8 /activemodel
parent66b7eb19279820b6464ad2b9e3f2efadb08f2ff2 (diff)
parent5742f12b781ecb212cb746d329e188cb4ff73f70 (diff)
downloadrails-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.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