record.errors.add:net_income_uc_proportion,"income is from Universal Credit, state pensions or benefits cannot be All if person works part or full time"
record.errors.add:net_income_uc_proportion,"income is from Universal Credit, state pensions or benefits cannot be All if person works part or full time"
if(fields.any?{|field|["Full-time - 30 hours or more","Part-time - Less than 30 hours"].include?(field[:status])&&field[:relationship]=="Partner"})&&record.net_income_uc_proportion=="All"
record.errors.add:net_income_uc_proportion,"income is from Universal Credit, state pensions or benefits cannot be All if the partner works part or full time"
end
end
end
defvalidate(record)
defvalidate(record)
@ -79,6 +73,16 @@ class CaseLogValidator < ActiveModel::Validator
record.errors.add:net_income_uc_proportion,"income is from Universal Credit, state pensions or benefits cannot be All if the partner works part or full time"