diff options
author | Christopher Baines <mail@cbaines.net> | 2018-03-16 08:51:54 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2018-03-29 07:55:01 +0100 |
commit | 051c8bf612126fa79699c8bf45a661dde127f4a0 (patch) | |
tree | 849a3b05b4ab4b59a426761d7cf1da3cc7036349 /app/controllers/govuk_guix | |
parent | a8c8f68971dd9e20dee01d9f65c64283e41fe4a3 (diff) | |
download | govuk-mini-environment-admin-051c8bf612126fa79699c8bf45a661dde127f4a0.tar govuk-mini-environment-admin-051c8bf612126fa79699c8bf45a661dde127f4a0.tar.gz |
Add backend controllers, models and views
Also annotate existing models.
Diffstat (limited to 'app/controllers/govuk_guix')
-rw-r--r-- | app/controllers/govuk_guix/revisions_controller.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/app/controllers/govuk_guix/revisions_controller.rb b/app/controllers/govuk_guix/revisions_controller.rb index a890fd0..a0d8c01 100644 --- a/app/controllers/govuk_guix/revisions_controller.rb +++ b/app/controllers/govuk_guix/revisions_controller.rb @@ -1,4 +1,20 @@ class GovukGuix::RevisionsController < ApplicationController - def index + def show + @revision = GovukGuix::Revision.find(params['id']) end + + def enqueue_fetch_revision + revision = params.require('revision') + + GovukGuix::FetchRevisionJob.enqueue(revision) + + flash[:info] = "Fetching govuk-guix revision (#{revision})..." + redirect_to setup_path + end + + def fetch_revision_jobs + @_revision_jobs ||= GovukGuix::FetchRevisionJob.enqueued_jobs + end + + helper_method :fetch_revision_jobs end |