Browse Source

create new constants for enums

pull/216/head
MadeTech Dushan 4 years ago
parent
commit
efd1442406
  1. 5
      app/models/case_log.rb
  2. 13
      app/models/constants/case_log.rb

5
app/models/case_log.rb

@ -47,9 +47,8 @@ class CaseLog < ApplicationRecord
scope :for_organisation, ->(org) { where(owning_organisation: org).or(where(managing_organisation: org)) }
enum status: { "not_started" => 0, "in_progress" => 1, "completed" => 2 }
enum letting_in_sheltered_accomodation: { "Yes - sheltered housing" => 0, "Yes - extra care housing" => 1, "No" => 2, "Don't know" => 3 }
enum status: STATUS
enum letting_in_sheltered_accomodation: SHELTERED_ACCOMODATION
enum ethnic: ETHNIC
enum national: NATIONAL, _suffix: true
enum ecstat1: ECSTAT, _suffix: true

13
app/models/constants/case_log.rb

@ -1081,4 +1081,17 @@ module Constants::CaseLog
"Universal Credit with housing element (excluding housing benefit)",
"Universal Credit (without housing element)",
"Housing benefit and Universal Credit (without housing element)"].freeze
STATUS = {
"not_started" => 0,
"in_progress" => 1,
"completed" => 2
}.freeze
SHELTERED_ACCOMODATION = {
"Yes - sheltered housing" => 0,
"Yes - extra care housing" => 1,
"No" => 2,
"Don't know" => 3
}.freeze
end

Loading…
Cancel
Save