aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-06-01 20:42:03 +0100
committerChristopher Baines <mail@cbaines.net>2018-06-01 20:42:03 +0100
commitf98bdb86d09f803495c9c203c350a7f06d96a8de (patch)
treefef67e02a174a15b0795b3737a2667c9eb6e2206 /app
parent3fa08e707fbc7899c0964bef4b501e137991d838 (diff)
downloadgovuk-mini-environment-admin-f98bdb86d09f803495c9c203c350a7f06d96a8de.tar
govuk-mini-environment-admin-f98bdb86d09f803495c9c203c350a7f06d96a8de.tar.gz
Add an optional DataSnapshot to the MiniEnvironment model
To store if a DataSnapshot is being used.
Diffstat (limited to 'app')
-rw-r--r--app/models/mini_environment.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/mini_environment.rb b/app/models/mini_environment.rb
index 77e2f1b..c92a62c 100644
--- a/app/models/mini_environment.rb
+++ b/app/models/mini_environment.rb
@@ -32,6 +32,7 @@
# backend_id :integer
# backend_data :jsonb
# signon_users :jsonb
+# data_snapshot_id :integer
#
class MiniEnvironment < ApplicationRecord
@@ -50,6 +51,11 @@ class MiniEnvironment < ApplicationRecord
belongs_to :backend, polymorphic: true
has_many :services, class_name: 'MiniEnvironmentService', dependent: :destroy
+ belongs_to(
+ :data_snapshot,
+ class_name: 'GovukGuix::DataSnapshot',
+ optional: true
+ )
def enqueued_terraform_jobs
Que.execute("SELECT * FROM que_jobs WHERE args->>0 = '#{id}'")