aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorAlban Peignier2016-05-05 15:45:19 +0200
committerAlban Peignier2016-05-05 15:45:19 +0200
commit3adb65c09321d6edcec4045be6abeb34fe3bc672 (patch)
tree9c065a0f439e0cd8b8d0dacc4b7a631e92ab6747 /app/models
parent89092ca98ba6d1d692871db3e4b46f31dc9336ed (diff)
downloadchouette-core-3adb65c09321d6edcec4045be6abeb34fe3bc672.tar.bz2
Associate StopArea and StopAreaReferential. Refs #812
Diffstat (limited to 'app/models')
-rw-r--r--app/models/chouette/stop_area.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/chouette/stop_area.rb b/app/models/chouette/stop_area.rb
index 70d2edcbd..588014fff 100644
--- a/app/models/chouette/stop_area.rb
+++ b/app/models/chouette/stop_area.rb
@@ -14,6 +14,9 @@ class Chouette::StopArea < Chouette::TridentActiveRecord
has_and_belongs_to_many :routing_lines, :class_name => 'Chouette::Line', :foreign_key => "stop_area_id", :association_foreign_key => "line_id", :join_table => "routing_constraints_lines", :order => "lines.number"
has_and_belongs_to_many :routing_stops, :class_name => 'Chouette::StopArea', :foreign_key => "parent_id", :association_foreign_key => "child_id", :join_table => "stop_areas_stop_areas", :order => "stop_areas.name"
+ belongs_to :stop_area_referential
+ validates_presence_of :stop_area_referential_id
+
acts_as_tree :foreign_key => 'parent_id',:order => "name"
attr_accessor :stop_area_type