lib/active_object/range.rb in active_object-5.7.0 vs lib/active_object/range.rb in active_object-5.8.0

- old
+ new

@@ -6,15 +6,13 @@ def combine(other) to_a.concat(other.to_a) end def include_with_range?(other) - if other.is_a?(Range) - operator = exclude_end? && !other.exclude_end? ? :< : :<= - include?(other.first) && other.last.send(operator, last) - else - include?(other) - end + return include?(other) unless other.is_a?(Range) + + operator = exclude_end? && !other.exclude_end? ? :< : :<= + include?(other.first) && other.last.send(operator, last) end def overlaps?(other) cover?(other.first) || other.cover?(first) end