aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobert2017-05-02 21:44:59 +0200
committerRobert2017-05-02 21:44:59 +0200
commit1a8961555e8f674eb989f7f4af4c4a22b25856b0 (patch)
tree0f2c09c36b1c228cc254d023575c3b5baff74372 /lib
parent7ce3dfa2770b2022f909164a0f24f8f38d8d8fb2 (diff)
downloadchouette-core-1a8961555e8f674eb989f7f4af4c4a22b25856b0.tar.bz2
duplicate code from models/calendar removed; coherent naming in Range#intersection
Diffstat (limited to 'lib')
-rw-r--r--lib/range_ext.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/range_ext.rb b/lib/range_ext.rb
index 5afb44dee..729cd1092 100644
--- a/lib/range_ext.rb
+++ b/lib/range_ext.rb
@@ -1,7 +1,7 @@
class Range
def intersection(other)
- return nil if (self.max < other.begin or other.max < self.begin)
- [self.begin, other.begin].max..[self.max, other.max].min
+ return nil if (self.max < other.min or other.max < self.min)
+ [self.min, other.min].max..[self.max, other.max].min
end
alias_method :&, :intersection
end