Skip to content

Commit

Permalink
CLDC-3850: Clear postcode_known when clearing postcode_full (#2910)
Browse files Browse the repository at this point in the history
* CLDC-3850: Clear postcode_known when clearing postcode_full

* Use different variables for lettings and sales postcode known
  • Loading branch information
RachaelBooth authored Jan 22, 2025
1 parent fec5b77 commit 7e35b4b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/models/log.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ def field_formatted_as_currency(field_name)
end

def blank_compound_invalid_non_setup_fields!
if errors.attribute_names.include? :postcode_full
self.postcode_known = nil if lettings?
self.pcodenk = nil if sales?
end

self.ppcodenk = nil if errors.attribute_names.include? :ppostcode_full
self.previous_la_known = nil if errors.attribute_names.include? :prevloc

Expand All @@ -258,6 +263,8 @@ def blank_compound_invalid_non_setup_fields!
self.address_line2 = nil
self.town_or_city = nil
self.postcode_full = nil
self.postcode_known = nil if lettings?
self.pcodenk = nil if sales?
self.county = nil
process_postcode_changes!
end
Expand Down

0 comments on commit 7e35b4b

Please sign in to comment.