summaryrefslogtreecommitdiff
path: root/lib/api/notes.rb
diff options
context:
space:
mode:
authorBen Bodenmiller <bbodenmiller@hotmail.com>2019-08-25 11:00:08 +0000
committerBen Bodenmiller <bbodenmiller@hotmail.com>2019-08-25 11:00:08 +0000
commitf2371a89f151da21e2d139f7cb159d611ba6fd0b (patch)
tree5692b4b958026565e4438063a522942d9da428eb /lib/api/notes.rb
parentd90b361b7c8c1aa7faa9ef1ead40e096d4ae7e42 (diff)
parent8112fb37544557b3f94c0a558175d5da99ef9829 (diff)
downloadgitlab-ce-docs-gitaly-path-fixes.tar.gz
Merge branch 'master' into 'docs-gitaly-path-fixes'docs-gitaly-path-fixes
# Conflicts: # doc/administration/gitaly/index.md
Diffstat (limited to 'lib/api/notes.rb')
-rw-r--r--lib/api/notes.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/api/notes.rb b/lib/api/notes.rb
index 9381f045144..84563d66ee8 100644
--- a/lib/api/notes.rb
+++ b/lib/api/notes.rb
@@ -36,12 +36,13 @@ module API
# page can have less elements than :per_page even if
# there's more than one page.
raw_notes = noteable.notes.with_metadata.reorder(order_options_with_tie_breaker)
- notes =
- # paginate() only works with a relation. This could lead to a
- # mismatch between the pagination headers info and the actual notes
- # array returned, but this is really a edge-case.
- paginate(raw_notes)
- .reject { |n| n.cross_reference_not_visible_for?(current_user) }
+
+ # paginate() only works with a relation. This could lead to a
+ # mismatch between the pagination headers info and the actual notes
+ # array returned, but this is really a edge-case.
+ notes = paginate(raw_notes)
+ notes = prepare_notes_for_rendering(notes)
+ notes = notes.reject { |n| n.cross_reference_not_visible_for?(current_user) }
present notes, with: Entities::Note
end
# rubocop: enable CodeReuse/ActiveRecord