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
c508aec6
Commit
c508aec6
authored
Feb 25, 2019
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor epic notes target before_action
Overrides `#create_note_params` instead
parent
a2266aae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
ee/app/controllers/groups/epics/notes_controller.rb
ee/app/controllers/groups/epics/notes_controller.rb
+6
-3
No files found.
ee/app/controllers/groups/epics/notes_controller.rb
View file @
c508aec6
# frozen_string_literal: true
# frozen_string_literal: true
class
Groups::Epics::NotesController
<
Groups
::
ApplicationController
class
Groups::Epics::NotesController
<
Groups
::
ApplicationController
extend
::
Gitlab
::
Utils
::
Override
include
NotesActions
include
NotesActions
include
NotesHelper
include
NotesHelper
include
ToggleAwardEmoji
include
ToggleAwardEmoji
before_action
:set_target_params
,
only:
[
:create
]
before_action
:epic
before_action
:epic
before_action
:authorize_create_note!
,
only:
[
:create
]
before_action
:authorize_create_note!
,
only:
[
:create
]
...
@@ -44,8 +44,11 @@ class Groups::Epics::NotesController < Groups::ApplicationController
...
@@ -44,8 +44,11 @@ class Groups::Epics::NotesController < Groups::ApplicationController
EpicNoteSerializer
.
new
(
project:
nil
,
noteable:
noteable
,
current_user:
current_user
)
EpicNoteSerializer
.
new
(
project:
nil
,
noteable:
noteable
,
current_user:
current_user
)
end
end
def
set_target_params
override
:create_note_params
def
create_note_params
params
[
:target_type
]
=
'Epic'
params
[
:target_type
]
=
'Epic'
params
[
:target_id
]
=
epic
.
id
params
[
:target_id
]
=
epic
.
id
super
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