Browse Source

CLDC-3850: Clear postcode_known when clearing postcode_full (#2910)

* CLDC-3850: Clear postcode_known when clearing postcode_full

* Use different variables for lettings and sales postcode known
pull/2913/head
Rachael Booth 5 days ago committed by GitHub
parent
commit
7e35b4b563
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      app/models/log.rb

7
app/models/log.rb

@ -248,6 +248,11 @@ class Log < ApplicationRecord
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
@ -258,6 +263,8 @@ class Log < ApplicationRecord
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

Loading…
Cancel
Save