diff --git a/app/models/form.rb b/app/models/form.rb index 6176f8850..57b529f10 100644 --- a/app/models/form.rb +++ b/app/models/form.rb @@ -127,9 +127,9 @@ class Form end def invalidated_page_questions(case_log, current_user = nil) - # we're already treating address fields as a special case and reset their values upon saving a case_log - address_questions = %w[postcode_known la ppcodenk previous_la_known prevloc postcode_full ppostcode_full] - questions.reject { |q| q.page.routed_to?(case_log, current_user) || q.derived? || address_questions.include?(q.id) } || [] + # we're already treating these fields as a special case and reset their values upon saving a case_log + callback_questions = %w[postcode_known la ppcodenk previous_la_known prevloc postcode_full ppostcode_full location_id] + questions.reject { |q| q.page.routed_to?(case_log, current_user) || q.derived? || callback_questions.include?(q.id) } || [] end def enabled_page_questions(case_log) diff --git a/app/models/form/setup/questions/location_id.rb b/app/models/form/setup/questions/location_id.rb index f743905d8..b3ddfdb0c 100644 --- a/app/models/form/setup/questions/location_id.rb +++ b/app/models/form/setup/questions/location_id.rb @@ -5,7 +5,6 @@ class Form::Setup::Questions::LocationId < ::Form::Question @header = "Which location is this log for?" @hint_text = "" @type = "radio" - @derived = true @answer_options = answer_options end diff --git a/spec/models/form/setup/questions/location_id_spec.rb b/spec/models/form/setup/questions/location_id_spec.rb index e616dfa61..c8681810f 100644 --- a/spec/models/form/setup/questions/location_id_spec.rb +++ b/spec/models/form/setup/questions/location_id_spec.rb @@ -28,7 +28,7 @@ RSpec.describe Form::Setup::Questions::LocationId, type: :model do end it "is marked as derived" do - expect(question).to be_derived + expect(question).not_to be_derived end context "when there are no locations" do