Browse Source

Small refactors

CLDC-4461-hide-confidential-addresses
oscric 2 days ago
parent
commit
cf9a4097b7
  1. 4
      app/models/derived_variables/lettings_log_variables.rb
  2. 8
      app/models/lettings_log.rb

4
app/models/derived_variables/lettings_log_variables.rb

@ -181,8 +181,6 @@ module DerivedVariables::LettingsLogVariables
self.la = nil
end
clear_gender_description_unless_gender_not_same_as_sex! if form.start_year_2026_or_later?
if scheme_has_confidential_information?
reset_address_fields!
self.uprn_selection = nil
@ -190,6 +188,8 @@ module DerivedVariables::LettingsLogVariables
self.manual_address_entry_selected = nil
end
clear_gender_description_unless_gender_not_same_as_sex! if form.start_year_2026_or_later?
set_checkbox_values!
end

8
app/models/lettings_log.rb

@ -228,7 +228,7 @@ class LettingsLog < Log
return super unless location
return super if form.start_year_2026_or_later? && super
location_derived_la
location.linked_local_authorities.active(form.start_date).first&.code || location.location_code
end
def postcode_full
@ -849,12 +849,6 @@ class LettingsLog < Log
private
def location_derived_la
return unless location
location.linked_local_authorities.active(form.start_date).first&.code || location.location_code
end
def reset_invalid_unresolved_log_fields!
return unless unresolved?

Loading…
Cancel
Save