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
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
......
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