diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-04-07 19:28:04 +0900 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-04-07 16:17:28 +0200 |
commit | fb8c49db8b16e45a33cff2839390bcbaab262075 (patch) | |
tree | ac627295a3eac56b3f659043d03a9b336f49bc86 /app | |
parent | 2f5095c2546af30da152e85a499c98d608465988 (diff) | |
download | gitlab-ce-fb8c49db8b16e45a33cff2839390bcbaab262075.tar.gz |
create_params and update_params into trigger_params
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/triggers_controller.rb | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/app/controllers/projects/triggers_controller.rb b/app/controllers/projects/triggers_controller.rb index 4f5d336ce40..c1fc40f75d7 100644 --- a/app/controllers/projects/triggers_controller.rb +++ b/app/controllers/projects/triggers_controller.rb @@ -11,7 +11,7 @@ class Projects::TriggersController < Projects::ApplicationController end def create - @trigger = project.triggers.create(create_params.merge(owner: current_user)) + @trigger = project.triggers.create(trigger_params.merge(owner: current_user)) if @trigger.valid? flash[:notice] = 'Trigger was created successfully.' @@ -37,7 +37,7 @@ class Projects::TriggersController < Projects::ApplicationController end def update - if trigger.update(update_params) + if trigger.update(trigger_params) redirect_to namespace_project_settings_ci_cd_path(@project.namespace, @project), notice: 'Trigger was successfully updated.' else render action: "edit" @@ -68,17 +68,10 @@ class Projects::TriggersController < Projects::ApplicationController @trigger ||= project.triggers.find(params[:id]) || render_404 end - def create_params + def trigger_params params.require(:trigger).permit( :description, :ref, - trigger_schedule_attributes: [ :cron, :cron_timezone, :_destroy ] - ) - end - - def update_params - params.require(:trigger).permit( - :description, :ref, - trigger_schedule_attributes: [ :cron, :cron_timezone, :_destroy ] + trigger_schedule_attributes: [:cron, :cron_timezone, :_destroy] ) end end |