Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
0feeddaa
Commit
0feeddaa
authored
Feb 24, 2018
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drop the ! from synchronize_service_state! + remove unused scope
parent
22e2cad9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
5 deletions
+3
-5
app/models/clusters/cluster.rb
app/models/clusters/cluster.rb
+0
-2
app/models/project_services/prometheus_service.rb
app/models/project_services/prometheus_service.rb
+2
-2
spec/models/project_services/prometheus_service_spec.rb
spec/models/project_services/prometheus_service_spec.rb
+1
-1
No files found.
app/models/clusters/cluster.rb
View file @
0feeddaa
...
@@ -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
...
...
app/models/project_services/prometheus_service.rb
View file @
0feeddaa
...
@@ -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
...
...
spec/models/project_services/prometheus_service_spec.rb
View file @
0feeddaa
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment