From aa7fdfb859d8a73f58460a7aba7174a47b5101d5 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Fri, 15 Nov 2013 01:11:57 -0200 Subject: Remove short circuit return in favor of simple conditional --- activemodel/lib/active_model/validations/clusivity.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/activemodel/lib/active_model/validations/clusivity.rb b/activemodel/lib/active_model/validations/clusivity.rb index fd6cc1edb4..bad9e4f9a9 100644 --- a/activemodel/lib/active_model/validations/clusivity.rb +++ b/activemodel/lib/active_model/validations/clusivity.rb @@ -35,10 +35,13 @@ module ActiveModel # Range#cover? uses the previous logic of comparing a value with the range # endpoints, which is fast but is only accurate on Numeric, Time, or DateTime ranges. def inclusion_method(enumerable) - return :include? unless enumerable.is_a?(Range) - case enumerable.first - when Numeric, Time, DateTime - :cover? + if enumerable.is_a? Range + case enumerable.first + when Numeric, Time, DateTime + :cover? + else + :include? + end else :include? end -- cgit v1.2.3