aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorRobert2017-05-02 22:10:31 +0200
committerRobert2017-05-02 22:10:31 +0200
commite89703a1646711ea2387e6058765aa3c6b953971 (patch)
tree77a2fb1bc960587e17bb48409b89ee4d5b0d4f88 /app
parentcd8b08325558f6339e953b69fa64fa58a90bf3f2 (diff)
downloadchouette-core-e89703a1646711ea2387e6058765aa3c6b953971.tar.bz2
more duplicates of Range#intersection removed and range_ext required instead
Diffstat (limited to 'app')
-rw-r--r--app/models/calendar.rb1
-rw-r--r--app/models/referential_metadata.rb9
2 files changed, 2 insertions, 8 deletions
diff --git a/app/models/calendar.rb b/app/models/calendar.rb
index 4890540b9..cd945a67f 100644
--- a/app/models/calendar.rb
+++ b/app/models/calendar.rb
@@ -1,3 +1,4 @@
+require 'range_ext'
class Calendar < ActiveRecord::Base
belongs_to :organisation
has_many :time_tables
diff --git a/app/models/referential_metadata.rb b/app/models/referential_metadata.rb
index 3ec8398e0..357465c63 100644
--- a/app/models/referential_metadata.rb
+++ b/app/models/referential_metadata.rb
@@ -1,4 +1,5 @@
require 'activeattr_ext.rb'
+require 'range_ext'
class ReferentialMetadata < ActiveRecord::Base
belongs_to :referential, touch: true
@@ -160,11 +161,3 @@ class ReferentialMetadata < ActiveRecord::Base
end
end
end
-
-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
- end
- alias_method :&, :intersection
-end