From ed2f7e23d675b1ab16a4e93a78b5aa9c3e0d698a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Cunha?= Date: Fri, 15 Feb 2019 11:16:45 +0000 Subject: Rename scope to imply :installed and :updated result - Adds to specs the case where apps are also updated - Rename scope calls on Gitlab::UsageData and Clusters::Cluster - Removes a duplicated spec --- app/models/clusters/concerns/application_status.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'app/models/clusters/concerns') diff --git a/app/models/clusters/concerns/application_status.rb b/app/models/clusters/concerns/application_status.rb index 5c0164831bc..1273ed83abe 100644 --- a/app/models/clusters/concerns/application_status.rb +++ b/app/models/clusters/concerns/application_status.rb @@ -6,7 +6,14 @@ module Clusters extend ActiveSupport::Concern included do - scope :installed, -> { where(status: self.state_machines[:status].states[:installed].value) } + scope :available, -> do + where( + status: [ + self.state_machines[:status].states[:installed].value, + self.state_machines[:status].states[:updated].value + ] + ) + end state_machine :status, initial: :not_installable do state :not_installable, value: -2 -- cgit v1.2.3