From 3adb65c09321d6edcec4045be6abeb34fe3bc672 Mon Sep 17 00:00:00 2001 From: Alban Peignier Date: Thu, 5 May 2016 15:45:19 +0200 Subject: Associate StopArea and StopAreaReferential. Refs #812 --- app/models/chouette/stop_area.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app') 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 -- cgit v1.2.3