drop the ! from synchronize_service_state! + remove unused scope

This commit is contained in:
Pawel Chojnacki 2018-02-24 01:06:08 +01:00
parent 22e2cad910
commit 0feeddaa0f
3 changed files with 3 additions and 5 deletions

View File

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

View File

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

View File

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