debian-mirror-gitlab/app/controllers/admin/integrations_controller.rb

22 lines
582 B
Ruby
Raw Normal View History

2020-04-08 14:13:33 +05:30
# frozen_string_literal: true
class Admin::IntegrationsController < Admin::ApplicationController
2020-04-22 19:07:51 +05:30
include IntegrationsActions
2020-04-08 14:13:33 +05:30
2020-04-22 19:07:51 +05:30
private
2020-04-08 14:13:33 +05:30
2020-04-22 19:07:51 +05:30
def find_or_initialize_integration(name)
if name.in?(Service.available_services_names)
"#{name}_service".camelize.constantize.find_or_initialize_by(instance: true) # rubocop:disable CodeReuse/ActiveRecord
2020-04-08 14:13:33 +05:30
end
end
2020-04-22 19:07:51 +05:30
def integrations_enabled?
2020-04-08 14:13:33 +05:30
Feature.enabled?(:instance_level_integrations)
end
2020-04-22 19:07:51 +05:30
def scoped_edit_integration_path(integration)
edit_admin_application_settings_integration_path(integration)
2020-04-08 14:13:33 +05:30
end
end