diff options
author | Nermin Vehabovic <nermin.vehabovic90@gmail.com> | 2019-02-16 13:03:42 +0300 |
---|---|---|
committer | Nermin Vehabovic <nermin.vehabovic90@gmail.com> | 2019-02-16 13:03:42 +0300 |
commit | ff671366cb80a78c2846d5407d2380680a47a90d (patch) | |
tree | 8b13498b784daa5643520867e2333ba1954ec7ff /lib/api/notes.rb | |
parent | 3967412f7e430d5a70560da8c7d6990a0aeec029 (diff) |
Added: Include order by ID desc for tie breakers in pagination
Diffstat (limited to 'lib/api/notes.rb')
-rw-r--r-- | lib/api/notes.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/notes.rb b/lib/api/notes.rb index 1bdf7aeb119..f7bd092ce50 100644 --- a/lib/api/notes.rb +++ b/lib/api/notes.rb @@ -39,7 +39,7 @@ module API # at the DB query level (which we cannot in that case), the current # page can have less elements than :per_page even if # there's more than one page. - raw_notes = noteable.notes.with_metadata.reorder(params[:order_by] => params[:sort]) + 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 |