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:
authorJoão Cunha <j.a.cunha@gmail.com>2019-02-15 14:16:45 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2019-02-15 14:16:45 +0300
commited2f7e23d675b1ab16a4e93a78b5aa9c3e0d698a (patch)
tree36015207419b8320c89d55c41a57918eecf04d5e /app/models/clusters/concerns
parent0b966fb0d95bb6e7070db50b4d1a64e3dddac1a4 (diff)
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
Diffstat (limited to 'app/models/clusters/concerns')
-rw-r--r--app/models/clusters/concerns/application_status.rb9
1 files changed, 8 insertions, 1 deletions
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