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:
authorThong Kuah <tkuah@gitlab.com>2019-01-18 07:38:28 +0300
committerThong Kuah <tkuah@gitlab.com>2019-01-18 07:38:28 +0300
commitd87486e678cd2d957e504109c3665ab84de1a6cc (patch)
tree11da91c5195e2ce0f996e51aacd58844ad8d0a4b /app/models/clusters/applications
parent8296ff580c2bb1b2a9ee07193f79f66fd6444de0 (diff)
Refactor some methods in Prometheus model
- #update_errored? method def is redundant, already defined from state machine - #update_in_progress? moved to ApplicationStatus - #ready_status becomes a constant. Previously it was extended in ee/ so maybe that was why it's a instance method
Diffstat (limited to 'app/models/clusters/applications')
-rw-r--r--app/models/clusters/applications/prometheus.rb17
1 files changed, 3 insertions, 14 deletions
diff --git a/app/models/clusters/applications/prometheus.rb b/app/models/clusters/applications/prometheus.rb
index 7a97760536a..26bf73f4dd8 100644
--- a/app/models/clusters/applications/prometheus.rb
+++ b/app/models/clusters/applications/prometheus.rb
@@ -5,7 +5,8 @@ module Clusters
class Prometheus < ActiveRecord::Base
include PrometheusAdapter
- VERSION = '6.7.3'.freeze
+ VERSION = '6.7.3'
+ READY_STATUS = [:installed, :updating, :updated, :update_errored].freeze
self.table_name = 'clusters_applications_prometheus'
@@ -24,20 +25,8 @@ module Clusters
end
end
- def ready_status
- [:installed, :updating, :updated, :update_errored]
- end
-
def ready?
- ready_status.include?(status_name)
- end
-
- def update_in_progress?
- status_name == :updating
- end
-
- def update_errored?
- status_name == :update_errored
+ READY_STATUS.include?(status_name)
end
def chart