Skip to content

Commit a95f730

Browse files
committed
Merge pull request rails#5124 from bquorning/prefer-||-over-'or'-for-boolean-operations
Prefer || over 'or' for boolean operations
2 parents 66b7eb1 + 5742f12 commit a95f730

File tree

1 file changed

+1
-1
lines changed
  • activemodel/lib/active_model/validations

1 file changed

+1
-1
lines changed

activemodel/lib/active_model/validations/length.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def check_validity!
2727
keys.each do |key|
2828
value = options[key]
2929

30-
unless value.is_a?(Integer) && value >= 0 or value == Float::INFINITY
30+
unless (value.is_a?(Integer) && value >= 0) || value == Float::INFINITY
3131
raise ArgumentError, ":#{key} must be a nonnegative Integer or Infinity"
3232
end
3333
end

0 commit comments

Comments
 (0)