diff options
author | Christopher Baines <mail@cbaines.net> | 2018-02-18 11:23:41 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2018-03-29 07:41:09 +0100 |
commit | bc1ffc5214ab3f563b60523d9c349fab7974e634 (patch) | |
tree | 1caa1ed8bf2fb96c4d340aeffd53cd50a8799980 /app/models | |
parent | 700b8b0a112fa976b9850418a7f0c71d95b6dd79 (diff) | |
download | govuk-mini-environment-admin-bc1ffc5214ab3f563b60523d9c349fab7974e634.tar govuk-mini-environment-admin-bc1ffc5214ab3f563b60523d9c349fab7974e634.tar.gz |
Add some govuk-guix related jobs
And various other views and routes.
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/govuk_guix.rb | 5 | ||||
-rw-r--r-- | app/models/govuk_guix/revision.rb | 3 | ||||
-rw-r--r-- | app/models/mini_environment.rb | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/app/models/govuk_guix.rb b/app/models/govuk_guix.rb new file mode 100644 index 0000000..e98da8e --- /dev/null +++ b/app/models/govuk_guix.rb @@ -0,0 +1,5 @@ +module GovukGuix + def self.table_name_prefix + 'govuk_guix_' + end +end diff --git a/app/models/govuk_guix/revision.rb b/app/models/govuk_guix/revision.rb new file mode 100644 index 0000000..147b6d6 --- /dev/null +++ b/app/models/govuk_guix/revision.rb @@ -0,0 +1,3 @@ +class GovukGuix::Revision < ApplicationRecord + self.primary_key = "commit_hash" +end diff --git a/app/models/mini_environment.rb b/app/models/mini_environment.rb index 2d6d8ae..87ecff8 100644 --- a/app/models/mini_environment.rb +++ b/app/models/mini_environment.rb @@ -1,5 +1,6 @@ class MiniEnvironment < ApplicationRecord has_many :finished_terraform_jobs, dependent: :destroy + belongs_to :govuk_guix_revision, class_name: 'GovukGuix::Revision' def enqueued_terraform_jobs Que.execute("SELECT * FROM que_jobs WHERE args->>0 = '#{id}'") |