diff --git a/app/models/case_log.rb b/app/models/case_log.rb index 3a838f86a..ec41634a0 100644 --- a/app/models/case_log.rb +++ b/app/models/case_log.rb @@ -200,11 +200,11 @@ class CaseLog < ApplicationRecord end def is_assessed_homeless? - !!(homeless && homeless.zero?) + homeless == 11 end def is_other_homeless? - homeless == 1 + homeless == 7 end def is_not_homeless? diff --git a/spec/models/validations/household_validations_spec.rb b/spec/models/validations/household_validations_spec.rb index 3dac48834..88b54832d 100644 --- a/spec/models/validations/household_validations_spec.rb +++ b/spec/models/validations/household_validations_spec.rb @@ -498,7 +498,7 @@ RSpec.describe Validations::HouseholdValidations do context "when homelessness is assessed" do it "cannot be internal transfer" do - record.homeless = 0 + record.homeless = 11 record.referral = 1 household_validator.validate_referral(record) expect(record.errors["referral"]) @@ -519,7 +519,7 @@ RSpec.describe Validations::HouseholdValidations do context "when homelessness is other" do it "cannot be internal transfer" do record.referral = 1 - record.homeless = 1 + record.homeless = 7 household_validator.validate_referral(record) expect(record.errors["referral"]) .to include(match I18n.t("validations.household.referral.other_homeless"))