From 6f68e632746f72469cbd1c1b6cb9d3f1ed1730a0 Mon Sep 17 00:00:00 2001 From: Shigeya Suzuki Date: Thu, 9 Feb 2012 22:08:28 -0800 Subject: make Range#overlaps? accept Range of Time --- activesupport/lib/active_support/core_ext/range/overlaps.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/core_ext/range/overlaps.rb b/activesupport/lib/active_support/core_ext/range/overlaps.rb index 7df653b53f..603657c180 100644 --- a/activesupport/lib/active_support/core_ext/range/overlaps.rb +++ b/activesupport/lib/active_support/core_ext/range/overlaps.rb @@ -3,6 +3,6 @@ class Range # (1..5).overlaps?(4..6) # => true # (1..5).overlaps?(7..9) # => false def overlaps?(other) - include?(other.first) || other.include?(first) + cover?(other.first) || other.cover?(first) end end -- cgit v1.2.3