aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorEdouard Maffert2016-09-09 16:07:34 +0200
committerEdouard Maffert2016-09-09 16:07:34 +0200
commit2d52366ebac8af84cfec37dab9df5b43261fffe4 (patch)
treeb820e064516f58b4f5fed6cddde99f7f5b9e042b /app/models
parent4747990c6d3ceb5020d06099d086500b066db6e4 (diff)
downloadchouette-core-2d52366ebac8af84cfec37dab9df5b43261fffe4.tar.bz2
associate networks to line referential
Diffstat (limited to 'app/models')
-rw-r--r--app/models/line_referential.rb1
-rw-r--r--app/models/referential.rb5
2 files changed, 2 insertions, 4 deletions
diff --git a/app/models/line_referential.rb b/app/models/line_referential.rb
index 7592bb5f1..ccab5bf8a 100644
--- a/app/models/line_referential.rb
+++ b/app/models/line_referential.rb
@@ -5,6 +5,7 @@ class LineReferential < ActiveRecord::Base
has_many :lines, class_name: 'Chouette::Line'
has_many :group_of_lines, class_name: 'Chouette::GroupOfLine'
has_many :companies, class_name: 'Chouette::Company'
+ has_many :networks, class_name: 'Chouette::Network'
has_one :line_referential_sync
diff --git a/app/models/referential.rb b/app/models/referential.rb
index 0063244e8..d8731a8d3 100644
--- a/app/models/referential.rb
+++ b/app/models/referential.rb
@@ -30,6 +30,7 @@ class Referential < ActiveRecord::Base
has_many :lines, through: :line_referential
has_many :companies, through: :line_referential
has_many :group_of_lines, through: :line_referential
+ has_many :networks, through: :line_referential
belongs_to :stop_area_referential
# validates_presence_of :stop_area_referential
@@ -59,10 +60,6 @@ class Referential < ActiveRecord::Base
self.class.human_attribute_name(*args)
end
- def networks
- Chouette::Network.all
- end
-
def stop_areas
Chouette::StopArea.all
end