From 03b1ffc1a0576f707b323f821597770d66eaae1e Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Fri, 1 Jun 2018 16:41:28 +0100 Subject: Add an optional association to backends for data snapshots I'm a bit unsure about this, but it feels like generating snapshots remotely is useful, but if that is supported, then a remote snapshot won't be available locally to use. Adding the option of making them backend specific is one way of working around this. --- app/models/govuk_guix/data_snapshot.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/models') diff --git a/app/models/govuk_guix/data_snapshot.rb b/app/models/govuk_guix/data_snapshot.rb index 4cec33a..ec40cc4 100644 --- a/app/models/govuk_guix/data_snapshot.rb +++ b/app/models/govuk_guix/data_snapshot.rb @@ -29,6 +29,8 @@ # created_at :datetime not null # updated_at :datetime not null # govuk_guix_revision_commit_hash :string not null +# backend_type :string +# backend_id :integer # class GovukGuix::DataSnapshot < ApplicationRecord @@ -37,4 +39,5 @@ class GovukGuix::DataSnapshot < ApplicationRecord class_name: 'GovukGuix::Revision', foreign_key: 'govuk_guix_revision_commit_hash' ) + belongs_to :backend, polymorphic: true, optional: true end -- cgit v1.2.3