aboutsummaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-04-07 15:27:38 +0100
committerChristopher Baines <mail@cbaines.net>2018-04-12 08:30:56 +0100
commit2e97d9f957eff4ba66f1c4c65ff0b5156471cf6c (patch)
tree7b55cfce7488fc59d75374e49850829f0931fb76 /app/controllers
parent13bf88b2e8e6cec0d2207fe7b92f7446eea49354 (diff)
downloadgovuk-mini-environment-admin-2e97d9f957eff4ba66f1c4c65ff0b5156471cf6c.tar
govuk-mini-environment-admin-2e97d9f957eff4ba66f1c4c65ff0b5156471cf6c.tar.gz
Change mini_environment_id to state_id on TerraformState
To allow supporting tracking related TerraformStates for backends as well.
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/terraform_http_backend_controller.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/controllers/terraform_http_backend_controller.rb b/app/controllers/terraform_http_backend_controller.rb
index ceff807..e4d8c54 100644
--- a/app/controllers/terraform_http_backend_controller.rb
+++ b/app/controllers/terraform_http_backend_controller.rb
@@ -23,7 +23,7 @@ class TerraformHttpBackendController < ApplicationController
def create
TerraformState.create(
- mini_environment_id: mini_environment_id,
+ state_id: state_id,
data: params
)
@@ -32,7 +32,7 @@ class TerraformHttpBackendController < ApplicationController
def show
state = TerraformState.where(
- mini_environment_id: mini_environment_id
+ state_id: state_id
).last
if state.nil?
@@ -44,13 +44,13 @@ class TerraformHttpBackendController < ApplicationController
def destroy
TerraformState
- .where(mini_environment_id: mini_environment_id)
+ .where(state_id: state_id)
.delete_all
render json: '{ "success": true }', status: 200
end
- def mini_environment_id
- params[:mini_environment_id]
+ def state_id
+ params[:state_id]
end
end