diff options
author | Job van der Voort <jobvandervoort@gmail.com> | 2015-04-21 17:21:51 +0300 |
---|---|---|
committer | Job van der Voort <jobvandervoort@gmail.com> | 2015-04-21 17:21:51 +0300 |
commit | a8e93b7f51d968c1380ed210499869b62b07fd15 (patch) | |
tree | c864e80dfd9cf4f83fcede678acc986e3a125bf5 /app/controllers/admin/services_controller.rb | |
parent | 0625b15a481b3a3edd88110b3c18031ad9068d2f (diff) |
Version 7.10.0.rc5v7.10.0.rc5
Diffstat (limited to 'app/controllers/admin/services_controller.rb')
-rw-r--r-- | app/controllers/admin/services_controller.rb | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/app/controllers/admin/services_controller.rb b/app/controllers/admin/services_controller.rb deleted file mode 100644 index 76a938c5fe4..00000000000 --- a/app/controllers/admin/services_controller.rb +++ /dev/null @@ -1,54 +0,0 @@ -class Admin::ServicesController < Admin::ApplicationController - before_filter :service, only: [:edit, :update] - - def index - @services = services_templates - end - - def edit - unless service.present? - redirect_to admin_application_settings_services_path, - alert: "Service is unknown or it doesn't exist" - end - end - - def update - if service.update_attributes(application_services_params[:service]) - redirect_to admin_application_settings_services_path, - notice: 'Application settings saved successfully' - else - render :edit - end - end - - private - - def services_templates - templates = [] - - Service.available_services_names.each do |service_name| - service_template = service_name.concat("_service").camelize.constantize - templates << service_template.where(template: true).first_or_create - end - - templates - end - - def service - @service ||= Service.where(id: params[:id], template: true).first - end - - def application_services_params - params.permit(:id, - service: [ - :title, :token, :type, :active, :api_key, :subdomain, - :room, :recipients, :project_url, :webhook, - :user_key, :device, :priority, :sound, :bamboo_url, :username, :password, - :build_key, :server, :teamcity_url, :build_type, - :description, :issues_url, :new_issue_url, :restrict_to_branch, - :send_from_committer_email, :disable_diffs, - :push_events, :tag_push_events, :note_events, :issues_events, - :merge_requests_events - ]) - end -end |