Browse Source

move out RENT_TYPE_MAPPING to constants file

pull/142/head
Kat 4 years ago
parent
commit
5412c2daf8
  1. 9
      app/models/case_log.rb
  2. 9
      app/models/constants/db_enums.rb

9
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"

9
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

Loading…
Cancel
Save