Commit bb96902e authored by Arturo Herrero's avatar Arturo Herrero

Refactor service external issue tracker and wiki

parent e261c79f
...@@ -422,8 +422,12 @@ class Service < ApplicationRecord ...@@ -422,8 +422,12 @@ class Service < ApplicationRecord
ProjectServiceWorker.perform_async(id, data) ProjectServiceWorker.perform_async(id, data)
end end
def issue_tracker? def external_issue_tracker?
self.category == :issue_tracker category == :issue_tracker && active?
end
def external_wiki?
type == 'ExternalWikiService' && active?
end end
# override if needed # override if needed
......
...@@ -34,11 +34,11 @@ class BulkCreateIntegrationService ...@@ -34,11 +34,11 @@ class BulkCreateIntegrationService
end end
def run_callbacks(batch) def run_callbacks(batch)
if integration.issue_tracker? && integration.active? if integration.external_issue_tracker?
batch.update_all(has_external_issue_tracker: true) batch.update_all(has_external_issue_tracker: true)
end end
if integration.type == 'ExternalWikiService' && integration.active? if integration.external_wiki?
batch.update_all(has_external_wiki: true) batch.update_all(has_external_wiki: true)
end end
end end
......
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