aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-06-21 23:25:27 +0100
committerChristopher Baines <mail@cbaines.net>2018-06-21 23:25:27 +0100
commit3f2561ef31851f43e9270679eb23304007aadd67 (patch)
treeefc5e29319c748a7db656c3ce9926f1ade1e4aa3
parent8e19306b741e54b08ea97c8e6d94458b832ddd63 (diff)
downloadgovuk-mini-environment-admin-3f2561ef31851f43e9270679eb23304007aadd67.tar
govuk-mini-environment-admin-3f2561ef31851f43e9270679eb23304007aadd67.tar.gz
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.
-rw-r--r--app/views/terraform_http_backend/show.html.erb4
1 files 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
</thead>
<tbody>
- <% 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) %>
<tr>