aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/chouette
diff options
context:
space:
mode:
authorGuillaume2017-11-09 17:49:38 +0100
committerGuillaume2017-11-09 17:49:38 +0100
commit2f8ff43fe89a8c78575fdb7a9737b5484117087c (patch)
tree672d6a0e709b7ca2039cd15ad04443c5a8b7d04d /app/models/chouette
parentaafda8b5d8e6dbd80ed56fd469d5ada5dceb3a67 (diff)
downloadchouette-core-2f8ff43fe89a8c78575fdb7a9737b5484117087c.tar.bz2
split modules objectid_format, remove alias referential
Diffstat (limited to 'app/models/chouette')
-rw-r--r--app/models/chouette/company.rb2
-rw-r--r--app/models/chouette/journey_pattern.rb2
-rw-r--r--app/models/chouette/line.rb2
-rw-r--r--app/models/chouette/network.rb2
-rw-r--r--app/models/chouette/route.rb2
-rw-r--r--app/models/chouette/routing_constraint_zone.rb1
-rw-r--r--app/models/chouette/stop_area.rb5
-rw-r--r--app/models/chouette/stop_point.rb2
-rw-r--r--app/models/chouette/time_table.rb2
-rw-r--r--app/models/chouette/vehicle_journey.rb2
10 files changed, 13 insertions, 9 deletions
diff --git a/app/models/chouette/company.rb b/app/models/chouette/company.rb
index ac7a7a0d9..f324dbd04 100644
--- a/app/models/chouette/company.rb
+++ b/app/models/chouette/company.rb
@@ -2,7 +2,7 @@ class Chouette::Company < Chouette::ActiveRecord
include CompanyRestrictions
include StifCodifligneAttributesSupport
include LineReferentialSupport
- include ObjectIdFormat
+ include ObjectIdFormatToLineReferential
has_many :lines
diff --git a/app/models/chouette/journey_pattern.rb b/app/models/chouette/journey_pattern.rb
index 7c801794f..1ba8ff61a 100644
--- a/app/models/chouette/journey_pattern.rb
+++ b/app/models/chouette/journey_pattern.rb
@@ -1,7 +1,7 @@
class Chouette::JourneyPattern < Chouette::TridentActiveRecord
include ChecksumSupport
include JourneyPatternRestrictions
- include ObjectIdFormat
+ include ObjectIdFormatToReferential
# FIXME http://jira.codehaus.org/browse/JRUBY-6358
self.primary_key = "id"
diff --git a/app/models/chouette/line.rb b/app/models/chouette/line.rb
index ba48068c9..383f5ceae 100644
--- a/app/models/chouette/line.rb
+++ b/app/models/chouette/line.rb
@@ -2,7 +2,7 @@ class Chouette::Line < Chouette::ActiveRecord
include StifCodifligneAttributesSupport
include LineRestrictions
include LineReferentialSupport
- include ObjectIdFormat
+ include ObjectIdFormatToLineReferential
extend StifTransportModeEnumerations
extend StifTransportSubmodeEnumerations
diff --git a/app/models/chouette/network.rb b/app/models/chouette/network.rb
index 69a0bd484..76c587141 100644
--- a/app/models/chouette/network.rb
+++ b/app/models/chouette/network.rb
@@ -2,7 +2,7 @@ class Chouette::Network < Chouette::ActiveRecord
include StifCodifligneAttributesSupport
include NetworkRestrictions
include LineReferentialSupport
- include ObjectIdFormat
+ include ObjectIdFormatToLineReferential
# FIXME http://jira.codehaus.org/browse/JRUBY-6358
self.primary_key = "id"
diff --git a/app/models/chouette/route.rb b/app/models/chouette/route.rb
index 66743afbd..d0c1adf1c 100644
--- a/app/models/chouette/route.rb
+++ b/app/models/chouette/route.rb
@@ -1,7 +1,7 @@
class Chouette::Route < Chouette::TridentActiveRecord
include RouteRestrictions
include ChecksumSupport
- include ObjectIdFormat
+ include ObjectIdFormatToReferential
extend Enumerize
extend ActiveModel::Naming
diff --git a/app/models/chouette/routing_constraint_zone.rb b/app/models/chouette/routing_constraint_zone.rb
index efe1b7237..0e22acd42 100644
--- a/app/models/chouette/routing_constraint_zone.rb
+++ b/app/models/chouette/routing_constraint_zone.rb
@@ -1,5 +1,6 @@
class Chouette::RoutingConstraintZone < Chouette::TridentActiveRecord
include ChecksumSupport
+ include ObjectIdFormatToReferential
belongs_to :route
has_array_of :stop_points, class_name: 'Chouette::StopPoint'
diff --git a/app/models/chouette/stop_area.rb b/app/models/chouette/stop_area.rb
index de2d4b01c..0735d9cae 100644
--- a/app/models/chouette/stop_area.rb
+++ b/app/models/chouette/stop_area.rb
@@ -10,7 +10,6 @@ class Chouette::StopArea < Chouette::ActiveRecord
include ProjectionFields
include StopAreaRestrictions
include StopAreaReferentialSupport
- include ObjectIdFormat
extend Enumerize
enumerize :area_type, in: %i(zdep zder zdlp zdlr lda)
@@ -64,6 +63,10 @@ class Chouette::StopArea < Chouette::ActiveRecord
end
end
+ def objectid_format
+ "#{self.stop_area_referential.objectid_format}_attributes_support".camelcase.constantize
+ end
+
def coordinates
@coordinates || combine_lat_lng
end
diff --git a/app/models/chouette/stop_point.rb b/app/models/chouette/stop_point.rb
index 7490d175b..99a893602 100644
--- a/app/models/chouette/stop_point.rb
+++ b/app/models/chouette/stop_point.rb
@@ -7,7 +7,7 @@ module Chouette
include ForBoardingEnumerations
include ForAlightingEnumerations
- include ObjectIdFormat
+ include ObjectIdFormatToReferential
# FIXME http://jira.codehaus.org/browse/JRUBY-6358
self.primary_key = "id"
diff --git a/app/models/chouette/time_table.rb b/app/models/chouette/time_table.rb
index 868b82f59..f4db0c3b1 100644
--- a/app/models/chouette/time_table.rb
+++ b/app/models/chouette/time_table.rb
@@ -1,7 +1,7 @@
class Chouette::TimeTable < Chouette::TridentActiveRecord
include ChecksumSupport
include TimeTableRestrictions
- include ObjectIdFormat
+ include ObjectIdFormatToReferential
# FIXME http://jira.codehaus.org/browse/JRUBY-6358
self.primary_key = "id"
diff --git a/app/models/chouette/vehicle_journey.rb b/app/models/chouette/vehicle_journey.rb
index ff7f4dc34..5e1b76ceb 100644
--- a/app/models/chouette/vehicle_journey.rb
+++ b/app/models/chouette/vehicle_journey.rb
@@ -2,7 +2,7 @@ module Chouette
class VehicleJourney < TridentActiveRecord
include ChecksumSupport
include VehicleJourneyRestrictions
- include ObjectIdFormat
+ include ObjectIdFormatToReferential
extend StifTransportModeEnumerations
# FIXME http://jira.codehaus.org/browse/JRUBY-6358
self.primary_key = "id"