diff --git a/app/admin/organisations.rb b/app/admin/organisations.rb index 50f2893ae..3b106c1f0 100644 --- a/app/admin/organisations.rb +++ b/app/admin/organisations.rb @@ -17,7 +17,7 @@ ActiveAdmin.register Organisation do selectable_column id_column column :name - column "org_type", :providertype + column "Org type", :providertype column "Address Line 1", :address_line1 column "Address Line 2", :address_line2 column :postcode diff --git a/app/models/case_log.rb b/app/models/case_log.rb index ea0278cf0..1f4a1fb36 100644 --- a/app/models/case_log.rb +++ b/app/models/case_log.rb @@ -192,7 +192,7 @@ private self.incref = 1 if net_income_known == "Prefer not to say" self.hhmemb = other_hhmemb + 1 if other_hhmemb.present? self.renttype = RENT_TYPE_MAPPING[rent_type] - self.lettype = "#{renttype} #{needstype} #{owning_organisation.org_type}" if renttype.present? && needstype.present? && owning_organisation.org_type.present? + self.lettype = "#{renttype} #{needstype} #{owning_organisation['Org type']}" if renttype.present? && needstype.present? && owning_organisation["Org type"].present? end def all_fields_completed? diff --git a/app/models/organisation.rb b/app/models/organisation.rb index c550bf375..dc46faf93 100644 --- a/app/models/organisation.rb +++ b/app/models/organisation.rb @@ -4,7 +4,7 @@ class Organisation < ApplicationRecord has_many :managed_case_logs, class_name: "CaseLog", foreign_key: "managing_organisation_id" include DbEnums - enum org_type: DbEnums.org_type, _suffix: true + enum "Org type": DbEnums.org_type, _suffix: true def case_logs CaseLog.for_organisation(self) @@ -27,7 +27,7 @@ class Organisation < ApplicationRecord name: name, address: address_string, telephone_number: phone, - type: org_type, + type: "Org type", local_authorities_operated_in: local_authorities, holds_own_stock: holds_own_stock, other_stock_owners: other_stock_owners, diff --git a/spec/factories/organisation.rb b/spec/factories/organisation.rb index 74bd0e44a..046a26724 100644 --- a/spec/factories/organisation.rb +++ b/spec/factories/organisation.rb @@ -1,7 +1,6 @@ FactoryBot.define do factory :organisation do name { "DLUHC" } - org_type { "LA" } address_line1 { "2 Marsham Street" } address_line2 { "London" } postcode { "SW1P 4DF" } diff --git a/spec/models/case_log_spec.rb b/spec/models/case_log_spec.rb index 064429a64..b94710b1b 100644 --- a/spec/models/case_log_spec.rb +++ b/spec/models/case_log_spec.rb @@ -838,7 +838,7 @@ RSpec.describe Form, type: :model do describe "derived variables" do require "date" - let(:organisation) { FactoryBot.create(:organisation, org_type: "PRP") } + let(:organisation) { FactoryBot.create(:organisation, "Org type": "PRP") } let!(:case_log) do CaseLog.create({ managing_organisation: organisation, diff --git a/spec/models/organisation_spec.rb b/spec/models/organisation_spec.rb index c5f2aaffc..1194483d9 100644 --- a/spec/models/organisation_spec.rb +++ b/spec/models/organisation_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Organisation, type: :model do let(:organisation) { user.organisation } it "has expected fields" do - expect(organisation.attribute_names).to include("name", "phone", "org_type") + expect(organisation.attribute_names).to include("name", "phone", "Org type") end it "has users" do