drop the ! from synchronize_service_state! + remove unused scope
This commit is contained in:
parent
22e2cad910
commit
0feeddaa0f
|
@ -49,8 +49,6 @@ module Clusters
|
|||
scope :enabled, -> { where(enabled: true) }
|
||||
scope :disabled, -> { where(enabled: false) }
|
||||
|
||||
scope :for_environment, -> (env) { where(environment_scope: ['*', '', env.slug]) }
|
||||
|
||||
def status_name
|
||||
if provider
|
||||
provider.status_name
|
||||
|
|
|
@ -9,7 +9,7 @@ class PrometheusService < MonitoringService
|
|||
validates :api_url, url: true
|
||||
end
|
||||
|
||||
before_save :synchronize_service_state!
|
||||
before_save :synchronize_service_state
|
||||
|
||||
after_save :clear_reactive_cache!
|
||||
|
||||
|
@ -82,7 +82,7 @@ class PrometheusService < MonitoringService
|
|||
|
||||
private
|
||||
|
||||
def synchronize_service_state!
|
||||
def synchronize_service_state
|
||||
self.active = prometheus_installed? || manual_configuration?
|
||||
|
||||
true
|
||||
|
|
|
@ -117,7 +117,7 @@ describe PrometheusService, :use_clean_rails_memory_store_caching do
|
|||
end
|
||||
end
|
||||
|
||||
describe '#synchronize_service_state! before_save callback' do
|
||||
describe '#synchronize_service_state before_save callback' do
|
||||
context 'no clusters with prometheus are installed' do
|
||||
context 'when service is inactive' do
|
||||
before do
|
||||
|
|
Loading…
Reference in New Issue