Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-03-30 18:34:10 +0300
committerMatija Čupić <matteeyah@gmail.com>2018-03-30 19:31:11 +0300
commitb26913a30c608f81c44abece263da8d01faf0126 (patch)
tree9990096775ab7dfb5c8fe1066f90ca5856b4cdc7 /app/models/clusters
parentf6fa84298282c78229e4028655cb87011372e2b2 (diff)
Extract cluster installed query to scope
Diffstat (limited to 'app/models/clusters')
-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