Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
elceebee committed Dec 19, 2024
1 parent c579ed1 commit 46bf163
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def self.build_from_application_choice(primary_reason, application_choice)
end

withdrawal_reasons.each do |withdrawal_reason|
if withdrawal_reason.reason.include?('personal-circumstances-have-changed.')
if withdrawal_reason.reason.include?("#{PERSONAL_CIRCUMSTANCES_KEY}.")
personal_circumstances_reasons << (withdrawal_reason.reason.split('.') - [primary_reason]).join('.')
personal_circumstances_reasons_comment = withdrawal_reason.comment if withdrawal_reason.comment.present?
else
Expand All @@ -61,7 +61,7 @@ def create!
@application_choice.draft_withdrawal_reasons.destroy_all

# Then create from valid form attributes
[secondary_reasons, personal_circumstances_reasons].flatten.each do |reason|
[secondary_reasons, personal_circumstances_reasons].flatten.compact.each do |reason|
next if reason == PERSONAL_CIRCUMSTANCES_KEY

other_comment = if reason == 'other'
Expand Down

0 comments on commit 46bf163

Please sign in to comment.