aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-06-21 23:00:18 +0100
committerChristopher Baines <mail@cbaines.net>2018-06-21 23:00:18 +0100
commitdabe71d35f521aafc0df614b021e9e3ae94e2289 (patch)
treeeca3baaa4c98511f65c629d801e5a68541c1a687
parent28a98595043eba29249578494bb21961f328bd05 (diff)
downloadgovuk-mini-environment-admin-dabe71d35f521aafc0df614b021e9e3ae94e2289.tar
govuk-mini-environment-admin-dabe71d35f521aafc0df614b021e9e3ae94e2289.tar.gz
Add a terraform_states method to MiniEnvironment
-rw-r--r--app/models/backends/terraform_libvirt/mini_environment_methods.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/backends/terraform_libvirt/mini_environment_methods.rb b/app/models/backends/terraform_libvirt/mini_environment_methods.rb
index 5a915cf..b89a07f 100644
--- a/app/models/backends/terraform_libvirt/mini_environment_methods.rb
+++ b/app/models/backends/terraform_libvirt/mini_environment_methods.rb
@@ -63,6 +63,12 @@ module Backends::TerraformLibvirt::MiniEnvironmentMethods
end
end
+ def terraform_states(mini_environment)
+ TerraformState.where(
+ state_id: mini_environment_state_id(mini_environment)
+ )
+ end
+
def within_terraform_working_directory(mini_environment, &block)
TerraformWorkingDirectory.new(
mini_environment_state_id(mini_environment),