Browse Source

CLDC-3248: Ensure previous_la_known gets cleared if prevloc is when blanking invalid fields

pull/2243/head
Rachael Booth 2 years ago
parent
commit
8529100719
  1. 1
      app/models/log.rb

1
app/models/log.rb

@ -179,6 +179,7 @@ class Log < ApplicationRecord
def blank_compound_invalid_non_setup_fields! def blank_compound_invalid_non_setup_fields!
self.ppcodenk = nil if errors.attribute_names.include? :ppostcode_full self.ppcodenk = nil if errors.attribute_names.include? :ppostcode_full
self.previous_la_known = nil if errors.attribute_names.include? :prevloc
if errors.of_kind?(:uprn, :uprn_error) if errors.of_kind?(:uprn, :uprn_error)
self.uprn_known = nil self.uprn_known = nil

Loading…
Cancel
Save