aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/workbench.rb
diff options
context:
space:
mode:
authorvlatka pavisic2016-11-09 15:10:29 +0100
committervlatka pavisic2016-11-09 15:10:29 +0100
commit21c6807d2167ffdbcaed58844d1ebafb06c22d6e (patch)
treed4f0bca5b97266f08a956de2b946a1bf79a3e964 /app/models/workbench.rb
parent56c0f55d2d8d566b931664b85c76dbe3a58e31cc (diff)
parent0dbc80d54b1362c9eb0fc87d8d93f3d60ade68e1 (diff)
downloadchouette-core-21c6807d2167ffdbcaed58844d1ebafb06c22d6e.tar.bz2
Refs #1872 : Fix conflicts
Diffstat (limited to 'app/models/workbench.rb')
-rw-r--r--app/models/workbench.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/workbench.rb b/app/models/workbench.rb
index 3525fe55e..a83fea70d 100644
--- a/app/models/workbench.rb
+++ b/app/models/workbench.rb
@@ -3,6 +3,12 @@ class Workbench < ActiveRecord::Base
belongs_to :line_referential
belongs_to :stop_area_referential
+ has_many :lines, -> (workbench) { Stif::MyWorkbenchScopes.new(workbench).line_scope(self) }, through: :line_referential
+ has_many :networks, through: :line_referential
+ has_many :companies, through: :line_referential
+ has_many :group_of_lines, through: :line_referential
+ has_many :stop_areas, through: :stop_area_referential
+
validates :name, presence: true
validates :organisation, presence: true