Permalink
Browse files

Use a simple conditional rather than short circuit with next

  • Loading branch information...
1 parent d299281 commit 4c7e3a3087d48ffbdf1c185ab12ef259b5f8e074 @carlosantoniodasilva carlosantoniodasilva committed Nov 15, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 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

0 comments on commit 4c7e3a3

Please sign in to comment.