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
0
Merge Requests
0
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
Léo-Paul Géneau
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
...
@@ -11,7 +11,7 @@ class Projects::TriggersController < Projects::ApplicationController
end
end
def
create
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?
if
@trigger
.
valid?
flash
[
:notice
]
=
'Trigger was created successfully.'
flash
[
:notice
]
=
'Trigger was created successfully.'
...
@@ -37,7 +37,7 @@ class Projects::TriggersController < Projects::ApplicationController
...
@@ -37,7 +37,7 @@ class Projects::TriggersController < Projects::ApplicationController
end
end
def
update
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.'
redirect_to
namespace_project_settings_ci_cd_path
(
@project
.
namespace
,
@project
),
notice:
'Trigger was successfully updated.'
else
else
render
action:
"edit"
render
action:
"edit"
...
@@ -68,17 +68,10 @@ class Projects::TriggersController < Projects::ApplicationController
...
@@ -68,17 +68,10 @@ class Projects::TriggersController < Projects::ApplicationController
@trigger
||=
project
.
triggers
.
find
(
params
[
:id
])
||
render_404
@trigger
||=
project
.
triggers
.
find
(
params
[
:id
])
||
render_404
end
end
def
create
_params
def
trigger
_params
params
.
require
(
:trigger
).
permit
(
params
.
require
(
:trigger
).
permit
(
:description
,
:ref
,
:description
,
:ref
,
trigger_schedule_attributes:
[
:cron
,
:cron_timezone
,
:_destroy
]
trigger_schedule_attributes:
[
:cron
,
:cron_timezone
,
:_destroy
]
)
end
def
update_params
params
.
require
(
:trigger
).
permit
(
:description
,
:ref
,
trigger_schedule_attributes:
[
:cron
,
:cron_timezone
,
:_destroy
]
)
)
end
end
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