Welcome to mirror list, hosted at ThFree Co, Russian Federation.

application_settings_controller.rb « admin « ci « controllers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 71e253fac6715beee89f0f3e781179903c1aec87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
module Ci
  class Admin::ApplicationSettingsController < Ci::Admin::ApplicationController
    before_action :set_application_setting

    def show
    end

    def update
      if @application_setting.update_attributes(application_setting_params)
        redirect_to ci_admin_application_settings_path,
          notice: 'Application settings saved successfully'
      else
        render :show
      end
    end

    private

    def set_application_setting
      @application_setting = Ci::ApplicationSetting.current
      @application_setting ||= Ci::ApplicationSetting.create_from_defaults
    end

    def application_setting_params
      params.require(:application_setting).permit(
        :all_broken_builds,
        :add_pusher,
      )
    end
  end
end