From c908e91f0023dfa28116572141084482503201b9 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Tue, 20 Mar 2018 09:14:12 +0100 Subject: [PATCH] Order budget headings by id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To maintain order after editing a heading’s name We should probably add timestamps to `groups` and `headings` and order by `created_at` instead Could have done it in a separate PR, but gotta keep moving to other priority issues. Creating issue for timestamps to do correctly and with tests :relieved: --- app/views/admin/budgets/_groups.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/budgets/_groups.html.erb b/app/views/admin/budgets/_groups.html.erb index 21b0635a4..52d09338e 100644 --- a/app/views/admin/budgets/_groups.html.erb +++ b/app/views/admin/budgets/_groups.html.erb @@ -14,6 +14,6 @@ <% groups.each do |group| %>
- <%= render "admin/budgets/group", group: group, headings: group.headings %> + <%= render "admin/budgets/group", group: group, headings: group.headings.order(:id) %>
<% end %>