diff --git a/app/models/case_log.rb b/app/models/case_log.rb index 6809d8a9c..08ec3ae3a 100644 --- a/app/models/case_log.rb +++ b/app/models/case_log.rb @@ -30,7 +30,7 @@ end class CaseLog < ApplicationRecord include Discard::Model include Validations::SoftValidations - include Constants::DbEnums + include Constants::CaseLog include Constants::IncomeRanges default_scope -> { kept } diff --git a/app/models/constants/db_enums.rb b/app/models/constants/case_log.rb similarity index 99% rename from app/models/constants/db_enums.rb rename to app/models/constants/case_log.rb index e4c5ace27..e7f1b84b2 100644 --- a/app/models/constants/db_enums.rb +++ b/app/models/constants/case_log.rb @@ -1,4 +1,4 @@ -module Constants::DbEnums +module Constants::CaseLog BENEFITCAP = { "Yes - benefit cap" => 5, "Yes - removal of the spare room subsidy" => 4, @@ -676,11 +676,6 @@ module Constants::DbEnums "Supported housing" => 2, }.freeze - ORG_TYPE = { - "LA" => 1, - "PRP" => 2, - }.freeze - LET_TYPE = { "Social Rent General needs PRP" => 1, "Social Rent Supported housing PRP" => 2, diff --git a/app/models/constants/organisation.rb b/app/models/constants/organisation.rb new file mode 100644 index 000000000..2a6501383 --- /dev/null +++ b/app/models/constants/organisation.rb @@ -0,0 +1,6 @@ +module Constants::Organisation + ORG_TYPE = { + "LA" => 1, + "PRP" => 2, + }.freeze +end diff --git a/app/models/organisation.rb b/app/models/organisation.rb index 84ab477bb..efd72bae5 100644 --- a/app/models/organisation.rb +++ b/app/models/organisation.rb @@ -3,7 +3,7 @@ class Organisation < ApplicationRecord has_many :owned_case_logs, class_name: "CaseLog", foreign_key: "owning_organisation_id" has_many :managed_case_logs, class_name: "CaseLog", foreign_key: "managing_organisation_id" - include Constants::DbEnums + include Constants::Organisation enum "Org type": ORG_TYPE, _suffix: true def case_logs