From 972cbb129747feb15c3c6c5ab5eabea2d7c045e1 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 25 Sep 2017 15:18:15 +0200 Subject: Workbench: Add `output` association The `output` attribute should be a `ReferentialSuite`. Refs #3520 --- app/models/workbench.rb | 1 + spec/models/workbench_spec.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/models/workbench.rb b/app/models/workbench.rb index 30692e625..234cb043f 100644 --- a/app/models/workbench.rb +++ b/app/models/workbench.rb @@ -2,6 +2,7 @@ class Workbench < ActiveRecord::Base belongs_to :organisation belongs_to :line_referential belongs_to :stop_area_referential + belongs_to :output, class_name: 'ReferentialSuite' has_many :lines, -> (workbench) { Stif::MyWorkbenchScopes.new(workbench).line_scope(self) }, through: :line_referential has_many :networks, through: :line_referential diff --git a/spec/models/workbench_spec.rb b/spec/models/workbench_spec.rb index 84149ddb0..617f34bb1 100644 --- a/spec/models/workbench_spec.rb +++ b/spec/models/workbench_spec.rb @@ -11,6 +11,7 @@ RSpec.describe Workbench, :type => :model do it { should belong_to(:organisation) } it { should belong_to(:line_referential) } it { should belong_to(:stop_area_referential) } + it { should belong_to(:output).class_name('ReferentialSuite') } it { should have_many(:lines).through(:line_referential) } it { should have_many(:networks).through(:line_referential) } -- cgit v1.2.3