module ActiveSupport::IncludeWithRange

def include?(value)

(5..9).include?(11) # => false
('a'..'f').include?('c') # => true
The native Range#include? behavior is untouched.

(1..5).include?(2..6) # => false
(1..5).include?(2..3) # => true
(1..5).include?(1..5) # => true
Extends the default Range#include? to support range comparisons.
:nodoc:
def include?(value)
  if value.is_a?(::Range)
    # 1...10 includes 1..9 but it does not include 1..10.
    operator = exclude_end? && !value.exclude_end? ? :< : :<=
    super(value.first) && value.last.send(operator, last)
  else
    super
  end
end