From 3f2561ef31851f43e9270679eb23304007aadd67 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 21 Jun 2018 23:25:27 +0100 Subject: Reverse the list of historical states On the terraform state show page. As it's more useful to see the recent states at the top. --- app/views/terraform_http_backend/show.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/terraform_http_backend/show.html.erb b/app/views/terraform_http_backend/show.html.erb index 9a99d52..764c172 100644 --- a/app/views/terraform_http_backend/show.html.erb +++ b/app/views/terraform_http_backend/show.html.erb @@ -28,7 +28,7 @@ License along with the GOV.UK Mini Environment Admin. If not, see <% historical_states = TerraformState .where(state_id: @state.state_id) - .order(:id) + .order(id: :asc) .to_a %> @@ -76,7 +76,7 @@ License along with the GOV.UK Mini Environment Admin. If not, see - <% historical_states.each_with_index do |historical_state, index| %> + <% historical_states.to_enum.with_index.reverse_each do |historical_state, index| %> <% current = (@state.id == historical_state.id) %> -- cgit v1.2.3