aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/chouette/line.rb
diff options
context:
space:
mode:
authorZog2018-02-19 09:58:49 +0100
committerJohan Van Ryseghem2018-02-20 09:50:28 +0100
commit5fe1e8762051ef567191210ab65e6916cf12b932 (patch)
treedfa90a85935d7aea613bbd4ae14c40c90aba5615 /app/models/chouette/line.rb
parent736bd34d8c496b81d456d4e4897197eac344247d (diff)
downloadchouette-core-5fe1e8762051ef567191210ab65e6916cf12b932.tar.bz2
Refs #5924 @14h; Extend importers
Mostly add a way to override the default behaviour and process each row its own way
Diffstat (limited to 'app/models/chouette/line.rb')
-rw-r--r--app/models/chouette/line.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/chouette/line.rb b/app/models/chouette/line.rb
index 874353752..5df45efbd 100644
--- a/app/models/chouette/line.rb
+++ b/app/models/chouette/line.rb
@@ -49,7 +49,7 @@ module Chouette
[:published_name, :number, :comment, :url, :color, :text_color, :stable_id]
end
- def local_id; registration_number end
+ def local_id; registration_number || id end
def geometry_presenter
Chouette::Geometry::LinePresenter.new self
@@ -83,6 +83,14 @@ module Chouette
line_referential.companies.where(id: ([company_id] + Array(secondary_company_ids)).compact)
end
+ def deactivate
+ self.deactivated = true
+ end
+
+ def activate
+ self.deactivated = false
+ end
+
def deactivate!
update_attribute :deactivated, true
end