From 9d002ca61305a665849c02c1d9498cfd21549434 Mon Sep 17 00:00:00 2001 From: Keith Lawrence Date: Mon, 17 Jun 2024 13:37:07 +0100 Subject: [PATCH] Handle manual updates on same day correctly - Previously manual updates to the same path on the same day were grouped together and only the last was shown, despite all being present in the content item. The grouping code was correct, but in the view only the last item was displayed. https://govuk.zendesk.com/agent/tickets/5624376 --- app/views/content_items/manuals/_updates.html.erb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/content_items/manuals/_updates.html.erb b/app/views/content_items/manuals/_updates.html.erb index f305104f3..e9fefefe2 100644 --- a/app/views/content_items/manuals/_updates.html.erb +++ b/app/views/content_items/manuals/_updates.html.erb @@ -25,13 +25,16 @@ <% change_notes = updated_documents.last %>
<% change_notes.each do |change_note_entry| %> + <% change_note_items = change_note_entry.last.collect { |i| i["change_note"] } %> <% change_note = change_note_entry.flatten.last %> <% if change_note["title"].present? %>

<%= link_to change_note["title"], change_note["base_path"], class: "govuk-link" %>

<% end %> - <%= simple_format(change_note["change_note"], class: "govuk-body") %> + <% change_note_items.each do |change_note_item| %> + <%= simple_format(change_note_item, class: "govuk-body") %> + <% end %> <% end %>
<% end