summaryrefslogtreecommitdiff
path: root/app/controllers/concerns/issuable_actions.rb
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2018-04-03 16:03:00 +0000
committerFatih Acet <acetfatih@gmail.com>2018-04-03 16:03:00 +0000
commit65664c2eaeed853396c97a9b46e404c05209c42e (patch)
treee903e3afa6fe5c0f3492dc443776ebd1ce8ade57 /app/controllers/concerns/issuable_actions.rb
parent67ca10f33ec41e7cecac152e016aa2c0956a7586 (diff)
downloadgitlab-ce-65664c2eaeed853396c97a9b46e404c05209c42e.tar.gz
Refactor discussions/notes code
Diffstat (limited to 'app/controllers/concerns/issuable_actions.rb')
-rw-r--r--app/controllers/concerns/issuable_actions.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/concerns/issuable_actions.rb b/app/controllers/concerns/issuable_actions.rb
index a21e658fda1..0379f76fc3d 100644
--- a/app/controllers/concerns/issuable_actions.rb
+++ b/app/controllers/concerns/issuable_actions.rb
@@ -88,11 +88,15 @@ module IssuableActions
discussions = Discussion.build_collection(notes, issuable)
- render json: DiscussionSerializer.new(project: project, noteable: issuable, current_user: current_user).represent(discussions, context: self)
+ render json: discussion_serializer.represent(discussions, context: self)
end
private
+ def discussion_serializer
+ DiscussionSerializer.new(project: project, noteable: issuable, current_user: current_user, note_entity: ProjectNoteEntity)
+ end
+
def recaptcha_check_if_spammable(should_redirect = true, &block)
return yield unless issuable.is_a? Spammable