From 5412c2daf80b3ea24eff63652ed1ebc0ba1390ba Mon Sep 17 00:00:00 2001 From: Kat Date: Thu, 2 Dec 2021 16:55:35 +0000 Subject: [PATCH] move out RENT_TYPE_MAPPING to constants file --- app/models/case_log.rb | 9 --------- app/models/constants/db_enums.rb | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/models/case_log.rb b/app/models/case_log.rb index 876597841..6809d8a9c 100644 --- a/app/models/case_log.rb +++ b/app/models/case_log.rb @@ -156,15 +156,6 @@ class CaseLog < ApplicationRecord private - RENT_TYPE_MAPPING = { - "Social rent" => "Social Rent", - "Affordable rent" => "Affordable Rent", - "London Affordable rent" => "Affordable Rent", - "Rent to buy" => "Intermediate Rent", - "London living rent" => "Intermediate Rent", - "Other intermediate rent product" => "Intermediate Rent", - }.freeze - def update_status! self.status = if all_fields_completed? && errors.empty? "completed" diff --git a/app/models/constants/db_enums.rb b/app/models/constants/db_enums.rb index e98e2d521..e4c5ace27 100644 --- a/app/models/constants/db_enums.rb +++ b/app/models/constants/db_enums.rb @@ -695,4 +695,13 @@ module Constants::DbEnums "Intermediate Rent General needs LA" => 11, "Intermediate Rent Supported housing LA" => 12, }.freeze + + RENT_TYPE_MAPPING = { + "Social rent" => "Social Rent", + "Affordable rent" => "Affordable Rent", + "London Affordable rent" => "Affordable Rent", + "Rent to buy" => "Intermediate Rent", + "London living rent" => "Intermediate Rent", + "Other intermediate rent product" => "Intermediate Rent", + }.freeze end