aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorcedricnjanga2017-11-22 12:30:38 +0100
committercedricnjanga2017-11-22 14:05:05 +0100
commitf7b9b6ad5280179367c225e1d35d123bad67dcaf (patch)
tree38e53dc036c42eaa2a7671200c1a0740d2d1dd86 /app/models
parent9304f16e56c219fd63fa12b7d42a7cbf16b2914a (diff)
downloadchouette-core-f7b9b6ad5280179367c225e1d35d123bad67dcaf.tar.bz2
Fix last spec and add short_id method to Netex Objectid
Diffstat (limited to 'app/models')
-rw-r--r--app/models/chouette/journey_pattern.rb2
-rw-r--r--app/models/chouette/objectid/netex.rb2
-rw-r--r--app/models/chouette/objectid/stif_codifligne.rb4
-rw-r--r--app/models/chouette/objectid/stif_reflex.rb4
4 files changed, 9 insertions, 3 deletions
diff --git a/app/models/chouette/journey_pattern.rb b/app/models/chouette/journey_pattern.rb
index 797b6adb1..c1f9fb4f8 100644
--- a/app/models/chouette/journey_pattern.rb
+++ b/app/models/chouette/journey_pattern.rb
@@ -11,8 +11,6 @@ module Chouette
has_many :vehicle_journey_at_stops, :through => :vehicle_journeys
has_and_belongs_to_many :stop_points, -> { order("stop_points.position") }, :before_add => :vjas_add, :before_remove => :vjas_remove, :after_add => :shortcuts_update_for_add, :after_remove => :shortcuts_update_for_remove
has_many :stop_areas, through: :stop_points
- has_many :journey_pattern_sections
- has_many :route_sections, through: :journey_pattern_sections, dependent: :destroy
validates_presence_of :route
validates_presence_of :name
diff --git a/app/models/chouette/objectid/netex.rb b/app/models/chouette/objectid/netex.rb
index 7953c6b12..57415ac98 100644
--- a/app/models/chouette/objectid/netex.rb
+++ b/app/models/chouette/objectid/netex.rb
@@ -26,7 +26,7 @@ module Chouette
end
def short_id
- local_id
+ local_id.try(:split, "-").try(:first)
end
end
end
diff --git a/app/models/chouette/objectid/stif_codifligne.rb b/app/models/chouette/objectid/stif_codifligne.rb
index a1e40f0a1..903ebc2dc 100644
--- a/app/models/chouette/objectid/stif_codifligne.rb
+++ b/app/models/chouette/objectid/stif_codifligne.rb
@@ -19,6 +19,10 @@ module Chouette
def to_s
"#{self.provider_id}:#{self.sync_id}:#{self.object_type}:#{self.local_id}"
end
+
+ def short_id
+ local_id
+ end
end
end
end \ No newline at end of file
diff --git a/app/models/chouette/objectid/stif_reflex.rb b/app/models/chouette/objectid/stif_reflex.rb
index 69a3f52fa..cd0f62298 100644
--- a/app/models/chouette/objectid/stif_reflex.rb
+++ b/app/models/chouette/objectid/stif_reflex.rb
@@ -18,6 +18,10 @@ module Chouette
def to_s
"#{self.country_code}:#{self.zip_code}:#{self.object_type}:#{self.local_id}:#{self.provider_id}"
end
+
+ def short_id
+ local_id
+ end
end
end
end \ No newline at end of file