Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
fb8c49db
Commit
fb8c49db
authored
Apr 07, 2017
by
Shinya Maeda
Committed by
Kamil Trzcinski
Apr 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create_params and update_params into trigger_params
parent
2f5095c2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
app/controllers/projects/triggers_controller.rb
app/controllers/projects/triggers_controller.rb
+4
-11
No files found.
app/controllers/projects/triggers_controller.rb
View file @
fb8c49db
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment