summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-03-30 17:34:10 +0200
committerMatija Čupić <matteeyah@gmail.com>2018-03-30 18:31:11 +0200
commitb26913a30c608f81c44abece263da8d01faf0126 (patch)
tree9990096775ab7dfb5c8fe1066f90ca5856b4cdc7 /app
parentf6fa84298282c78229e4028655cb87011372e2b2 (diff)
downloadgitlab-ce-b26913a30c608f81c44abece263da8d01faf0126.tar.gz
Extract cluster installed query to scope
Diffstat (limited to 'app')
-rw-r--r--app/models/clusters/cluster.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/clusters/cluster.rb b/app/models/clusters/cluster.rb
index 05e8d266bcf..77947d515c1 100644
--- a/app/models/clusters/cluster.rb
+++ b/app/models/clusters/cluster.rb
@@ -53,6 +53,8 @@ module Clusters
scope :disabled, -> { where(enabled: false) }
scope :user_provided, -> { where(provider_type: ::Clusters::Cluster.provider_types[:user]) }
scope :gcp_provided, -> { where(provider_type: ::Clusters::Cluster.provider_types[:gcp]) }
+ scope :gcp_installed, -> { gcp_provided.includes(:provider_gcp).where(cluster_providers_gcp: { status: ::Clusters::Providers::Gcp.state_machines[:status].states[:created].value }) }
+
scope :default_environment, -> { where(environment_scope: DEFAULT_ENVIRONMENT) }
def status_name