diff options
author | Christopher Baines <mail@cbaines.net> | 2018-03-29 07:00:29 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2018-04-03 21:58:55 +0100 |
commit | 8a5d96490debc19157bd74d992cbe121bce65c01 (patch) | |
tree | 9c987c71638bf60623d72dc1b5432d9acab84235 /app | |
parent | af6f2b6157e2a82ea45607b246ff320b0bf6413f (diff) | |
download | govuk-mini-environment-admin-8a5d96490debc19157bd74d992cbe121bce65c01.tar govuk-mini-environment-admin-8a5d96490debc19157bd74d992cbe121bce65c01.tar.gz |
Specify the ordering for revisions
And update the show page to use the default scope.
Diffstat (limited to 'app')
-rw-r--r-- | app/models/govuk_guix/revision.rb | 2 | ||||
-rw-r--r-- | app/views/setup/show.html.erb | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/app/models/govuk_guix/revision.rb b/app/models/govuk_guix/revision.rb index 45793b2..c971913 100644 --- a/app/models/govuk_guix/revision.rb +++ b/app/models/govuk_guix/revision.rb @@ -12,5 +12,7 @@ class GovukGuix::Revision < ApplicationRecord self.primary_key = 'commit_hash' + default_scope { order(:created_at).reverse_order } + has_many :mini_environments, foreign_key: 'govuk_guix_revision_id' end diff --git a/app/views/setup/show.html.erb b/app/views/setup/show.html.erb index 6f8be35..4fea193 100644 --- a/app/views/setup/show.html.erb +++ b/app/views/setup/show.html.erb @@ -59,8 +59,8 @@ </a> <% end %> <% end %> - - <% GovukGuix::Revision.order(:created_at).reverse_order.each do |revision| %> + + <% GovukGuix::Revision.all.each do |revision| %> <a href="<%= govuk_guix_revision_path(revision) %>" class="list-group-item"> <span class="badge" style="font-family: monospace;"> <%= revision.commit_hash %> |