Commit 675ec596 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch '9934-fix-spec-failure' into 'master'

Fix NotesController in EE failing since 16fe447d

Closes #9935 and #9934

See merge request gitlab-org/gitlab-ee!9680
parents 3959953c 538d780a
......@@ -5,9 +5,7 @@ class Groups::Epics::NotesController < Groups::ApplicationController
include NotesHelper
include ToggleAwardEmoji
# Re-defining the before_action set in NotesActions here without prepending pushes it farther down the callback stack
# and we do this here since we need variables instantiated in other before_actions
before_action :normalize_create_params, only: [:create]
before_action :set_target_params, only: [:create]
before_action :epic
before_action :authorize_create_note!, only: [:create]
......@@ -46,10 +44,8 @@ class Groups::Epics::NotesController < Groups::ApplicationController
EpicNoteSerializer.new(project: nil, noteable: noteable, current_user: current_user)
end
def normalize_create_params
params[:note].try do |note|
note[:noteable_id] = epic.id
note[:noteable_type] = 'Epic'
end
def set_target_params
params[:target_type] = 'Epic'
params[:target_id] = epic.id
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment