aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/workbench.rb
blob: f02c6a5a1552cfbf900cd1744f3b6a613a31a61c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class Workbench < ActiveRecord::Base
  belongs_to :organisation
  belongs_to :line_referential
  belongs_to :stop_area_referential

  has_many :lines, -> (workbench) { Stif::MyWorkbenchScopes.new(workbench).line_scope }, 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

  has_many :referentials

end