diff options
| author | Greg Myers <gmyers@gitlab.com> | 2019-08-27 15:51:04 +0000 |
|---|---|---|
| committer | Greg Myers <gmyers@gitlab.com> | 2019-08-27 15:51:04 +0000 |
| commit | 51a0166af2c532aa7a0d04bb503b43499be97033 (patch) | |
| tree | 9ebd74e8518d573fe4860763ddb41146dab1f453 /lib/api/notes.rb | |
| parent | f706677357fcdf9cd870d098379788543ea71058 (diff) | |
| parent | 27c222d16ccb666878c7ac558f484efa56f77f37 (diff) | |
| download | gitlab-ce-api-curl-quote-url-docs.tar.gz | |
Merge branch 'master' into 'api-curl-quote-url-docs'api-curl-quote-url-docs
# Conflicts:
# doc/api/events.md
Diffstat (limited to 'lib/api/notes.rb')
| -rw-r--r-- | lib/api/notes.rb | 13 |
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 |
