aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/govuk_guix/revisions_controller.rb
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-01-06 11:18:05 +0000
committerChristopher Baines <mail@cbaines.net>2019-01-06 11:18:05 +0000
commit1c097bf9041939b286c1d2f764f65bcf017cd117 (patch)
tree61b0cc6510503ac80948882c74a420a327dd510b /app/controllers/govuk_guix/revisions_controller.rb
parent9d3799ccefc4c9a546132f085dd9980a2cc9b7b6 (diff)
downloadgovuk-mini-environment-admin-1c097bf9041939b286c1d2f764f65bcf017cd117.tar
govuk-mini-environment-admin-1c097bf9041939b286c1d2f764f65bcf017cd117.tar.gz
Support archiving govuk-guix revisions
Diffstat (limited to 'app/controllers/govuk_guix/revisions_controller.rb')
-rw-r--r--app/controllers/govuk_guix/revisions_controller.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/controllers/govuk_guix/revisions_controller.rb b/app/controllers/govuk_guix/revisions_controller.rb
index 14a3161..e4e1b52 100644
--- a/app/controllers/govuk_guix/revisions_controller.rb
+++ b/app/controllers/govuk_guix/revisions_controller.rb
@@ -23,6 +23,15 @@ class GovukGuix::RevisionsController < ApplicationController
@revision = GovukGuix::Revision.find(params['id'])
end
+ def destroy
+ @revision = GovukGuix::Revision.find(params['id'])
+
+ @revision.update(archived: true)
+ flash[:info] = "Archived #{@revision.commit_hash}..."
+
+ render :show
+ end
+
def enqueue_fetch_revision
revision = params.require('revision')