summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-04-07 19:31:07 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-04-07 19:31:07 +0000
commit3ded903d7b0c477d63916ed6f0258392e4cb001a (patch)
tree334cdd8010cb5e1fae56105e938fca702d90479b /app/controllers
parent5d4449151fb576dc927ff1d0ff343fca4645159b (diff)
parent682748e8abbc05d3059c2f945cda9d18081947f5 (diff)
downloadgitlab-ce-3ded903d7b0c477d63916ed6f0258392e4cb001a.tar.gz
Merge branch 'dosuken123/gitlab-ce-2989-run-cicd-pipelines-on-a-schedule-idea1-basic-backend-implementation-with-quick-ui' into 'master'
Add "engineering" UI for Pipeline Schedule See merge request !10533
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/triggers_controller.rb15
1 files changed, 7 insertions, 8 deletions
diff --git a/app/controllers/projects/triggers_controller.rb b/app/controllers/projects/triggers_controller.rb
index c47198c5eb6..afa56de920b 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.'
@@ -36,7 +36,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"
@@ -67,11 +67,10 @@ class Projects::TriggersController < Projects::ApplicationController
@trigger ||= project.triggers.find(params[:id]) || render_404
end
- def create_params
- params.require(:trigger).permit(:description)
- end
-
- def update_params
- params.require(:trigger).permit(:description)
+ def trigger_params
+ params.require(:trigger).permit(
+ :description,
+ trigger_schedule_attributes: [:id, :active, :cron, :cron_timezone, :ref]
+ )
end
end