Module: Integrations::Actions

Extended by:
ActiveSupport::Concern
Included in:
Admin::IntegrationsController, Groups::Settings::IntegrationsController
Defined in:
app/controllers/concerns/integrations/actions.rb

Instance Method Summary collapse

Instance Method Details

#editObject



23
24
25
# File 'app/controllers/concerns/integrations/actions.rb', line 23

def edit
  render 'shared/integrations/edit'
end

#resetObject



52
53
54
55
56
57
58
# File 'app/controllers/concerns/integrations/actions.rb', line 52

def reset
  integration.destroy!

  flash[:notice] = s_('Integrations|This integration, and inheriting projects were reset.')

  render json: {}, status: :ok
end

#testObject



48
49
50
# File 'app/controllers/concerns/integrations/actions.rb', line 48

def test
  render json: {}, status: :ok
end

#updateObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'app/controllers/concerns/integrations/actions.rb', line 27

def update
  saved = integration.update(integration_params[:integration])

  respond_to do |format|
    format.html do
      if saved
        PropagateIntegrationWorker.perform_async(integration.id)
        redirect_to scoped_edit_integration_path(integration, project: integration.project, group: integration.group), notice: success_message
      else
        render 'shared/integrations/edit'
      end
    end

    format.json do
      status = saved ? :ok : :unprocessable_entity

      render json: serialize_as_json, status: status
    end
  end
end