Browse Source

feat: update linking behaviour

pull/938/head
natdeanlewissoftwire 3 years ago
parent
commit
fbf28c7a8e
  1. 3
      app/models/form/sales/pages/buyer_company.rb
  2. 3
      db/schema.rb
  3. 6
      spec/models/form/sales/pages/buyer_company_spec.rb

3
app/models/form/sales/pages/buyer_company.rb

@ -5,6 +5,9 @@ class Form::Sales::Pages::BuyerCompany < ::Form::Page
@header = "" @header = ""
@description = "" @description = ""
@subsection = subsection @subsection = subsection
@depends_on = [{
"ownershipsch" => 3,
}]
end end
def questions def questions

3
db/schema.rb

@ -348,15 +348,14 @@ ActiveRecord::Schema[7.0].define(version: 2022_10_05_150022) do
t.integer "age2" t.integer "age2"
t.integer "age2_known" t.integer "age2_known"
t.string "relat2" t.string "relat2"
t.string "otherrelat2"
t.string "sex2" t.string "sex2"
t.integer "noint" t.integer "noint"
t.integer "buy2livein" t.integer "buy2livein"
t.integer "ecstat2" t.integer "ecstat2"
t.integer "privacynotice" t.integer "privacynotice"
t.integer "ecstat1" t.integer "ecstat1"
t.integer "hholdcount"
t.integer "wheel" t.integer "wheel"
t.integer "hholdcount"
t.index ["created_by_id"], name: "index_sales_logs_on_created_by_id" t.index ["created_by_id"], name: "index_sales_logs_on_created_by_id"
t.index ["managing_organisation_id"], name: "index_sales_logs_on_managing_organisation_id" t.index ["managing_organisation_id"], name: "index_sales_logs_on_managing_organisation_id"
t.index ["owning_organisation_id"], name: "index_sales_logs_on_owning_organisation_id" t.index ["owning_organisation_id"], name: "index_sales_logs_on_owning_organisation_id"

6
spec/models/form/sales/pages/buyer_company_spec.rb

@ -26,4 +26,10 @@ RSpec.describe Form::Sales::Pages::BuyerCompany, type: :model do
it "has the correct description" do it "has the correct description" do
expect(page.description).to eq("") expect(page.description).to eq("")
end end
it "has correct depends_on" do
expect(page.depends_on).to eq([{
"ownershipsch" => 3,
}])
end
end end

Loading…
Cancel
Save