diff options
-rw-r--r-- | app/controllers/terraform_http_backend_controller.rb | 6 | ||||
-rw-r--r-- | app/models/backends.rb | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/terraform_http_backend_controller.rb b/app/controllers/terraform_http_backend_controller.rb index 761cb32..ceff807 100644 --- a/app/controllers/terraform_http_backend_controller.rb +++ b/app/controllers/terraform_http_backend_controller.rb @@ -31,9 +31,9 @@ class TerraformHttpBackendController < ApplicationController end def show - state = TerraformState - .where(mini_environment_id: mini_environment_id) - .last + state = TerraformState.where( + mini_environment_id: mini_environment_id + ).last if state.nil? render json: '{}', status: 404 diff --git a/app/models/backends.rb b/app/models/backends.rb index bafe9e8..0caf8fe 100644 --- a/app/models/backends.rb +++ b/app/models/backends.rb @@ -37,7 +37,7 @@ module Backends end def self.all - classes.flat_map { |backend| backend.all } + classes.flat_map(&:all) end def self.find_by_type_and_id(type_and_id) |