Commit 0feeddaa authored by Pawel Chojnacki's avatar Pawel Chojnacki

drop the ! from synchronize_service_state! + remove unused scope

parent 22e2cad9
...@@ -49,8 +49,6 @@ module Clusters ...@@ -49,8 +49,6 @@ module Clusters
scope :enabled, -> { where(enabled: true) } scope :enabled, -> { where(enabled: true) }
scope :disabled, -> { where(enabled: false) } scope :disabled, -> { where(enabled: false) }
scope :for_environment, -> (env) { where(environment_scope: ['*', '', env.slug]) }
def status_name def status_name
if provider if provider
provider.status_name provider.status_name
......
...@@ -9,7 +9,7 @@ class PrometheusService < MonitoringService ...@@ -9,7 +9,7 @@ class PrometheusService < MonitoringService
validates :api_url, url: true validates :api_url, url: true
end end
before_save :synchronize_service_state! before_save :synchronize_service_state
after_save :clear_reactive_cache! after_save :clear_reactive_cache!
...@@ -82,7 +82,7 @@ class PrometheusService < MonitoringService ...@@ -82,7 +82,7 @@ class PrometheusService < MonitoringService
private private
def synchronize_service_state! def synchronize_service_state
self.active = prometheus_installed? || manual_configuration? self.active = prometheus_installed? || manual_configuration?
true true
......
...@@ -117,7 +117,7 @@ describe PrometheusService, :use_clean_rails_memory_store_caching do ...@@ -117,7 +117,7 @@ describe PrometheusService, :use_clean_rails_memory_store_caching do
end end
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 'no clusters with prometheus are installed' do
context 'when service is inactive' do context 'when service is inactive' do
before do before do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment