Commit Graph

15 Commits

Author SHA1 Message Date
Andrew Newdigate 3288e1a874 Adds the Rubocop ReturnNil cop
This style change enforces `return if ...` instead of
`return nil if ...` to save maintainers a few minor review points
2019-03-06 17:51:56 +02:00
Adam Mulvany 38bbc097fa
Properly implement API pagination headers and add specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-02-21 18:29:00 +01:00
Rémy Coutable 3a2abc1d50
Enable the Layout/ExtraSpacing cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-01-24 13:05:45 +01:00
Rémy Coutable 26978cb270
[API] Omit X-Total{,-Pages} when count > 10k
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-01-22 18:13:04 +01:00
gfyoung 3836d69119 Enable frozen string in lib/api and lib/backup
Partially addresses #47424.

Had to make changes to spec files because
stubbing methods on frozen objects is a mess
in RSpec and leads to failures:

https://github.com/rspec/rspec-mocks/issues/1190
2018-09-29 21:04:50 -07:00
Yorick Peterse 2039c8280d
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
2018-09-11 17:32:00 +02:00
Andreas Brandl f5c4203121 Add feature-flag for keyset pagination. 2018-05-21 18:02:41 +02:00
Andreas Brandl f8aee5b086 Add keyset pagination for API calls.
Closes #45756.
2018-05-21 18:02:41 +02:00
Andreas Brandl cc1d141127 Refactor and extract DefaultPaginationStrategy. 2018-05-21 18:02:40 +02:00
Jarka Kadlecová 1b2400b529 Return only limited pagination headers for search API endpoints 2018-02-06 17:58:18 +01:00
Francisco Javier López 7c2b7296d4 Added default order to UserFinder 2017-12-04 09:49:53 +00:00
Toon Claes e17d9529fa Total Pages should be at least one
And the link to the last page cannot be `page=0`.
2017-08-17 21:47:01 +02:00
Jordan Patterson fdf4f0fc08 don't add next page link if current page is out of range 2017-08-17 21:47:01 +02:00
Robert Schilling 01ea65e0e9 Paginate all endpoints that return an array 2017-02-16 15:32:01 +01:00
Grzegorz Bizon 7870614fb9 Extract API pagination code to a separete module 2016-12-07 15:23:07 +01:00