Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use a simple conditional rather than short circuit with next

  • Loading branch information...
commit 4c7e3a3087d48ffbdf1c185ab12ef259b5f8e074 1 parent d299281
@carlosantoniodasilva carlosantoniodasilva authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 activemodel/lib/active_model/validations/numericality.rb
View
5 activemodel/lib/active_model/validations/numericality.rb
@@ -11,8 +11,9 @@ class NumericalityValidator < EachValidator # :nodoc:
def check_validity!
keys = CHECKS.keys - [:odd, :even]
options.slice(*keys).each do |option, value|
- next if value.is_a?(Numeric) || value.is_a?(Proc) || value.is_a?(Symbol)
- raise ArgumentError, ":#{option} must be a number, a symbol or a proc"
+ unless value.is_a?(Numeric) || value.is_a?(Proc) || value.is_a?(Symbol)
+ raise ArgumentError, ":#{option} must be a number, a symbol or a proc"
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.