From e308bb0cd2226297093ffb488a4d97e3c02c4883 Mon Sep 17 00:00:00 2001 From: Pawel Chojnacki Date: Thu, 4 Jan 2018 13:56:07 +0100 Subject: Cleanup implementation and add cluster finding tests --- app/models/clusters/cluster.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/models/clusters/cluster.rb') diff --git a/app/models/clusters/cluster.rb b/app/models/clusters/cluster.rb index 5ecbd4cbceb..8678f70f78c 100644 --- a/app/models/clusters/cluster.rb +++ b/app/models/clusters/cluster.rb @@ -49,6 +49,9 @@ module Clusters scope :enabled, -> { where(enabled: true) } scope :disabled, -> { where(enabled: false) } + scope :for_environment, -> (env) { where(environment_scope: ['*', '', env.slug]) } + scope :for_all_environments, -> { where(environment_scope: ['*', '']) } + def status_name if provider provider.status_name -- cgit v1.2.1