Commit Graph

13 Commits (049d9171ebeb8af02f89f24df982a2ce4c638015)

Author SHA1 Message Date
Nick Schonning ab7816a414
Autofix Rubocop Style/Lambda ()
tateisu fa0c71f0d9
allow pagination by min_id and max_id ()
* allow pagination by min_id and max_id

* also AccountConversation allows min_id,max_id pair

* also home,list TL allows min_id,max_id pair
Akihiko Odaki ae871c4d46
Make Array-creation behavior of Paginable more predictable ()
* Make Array-creation behavior of Paginable more predictable

Paginable.paginate_by_id usually returns ActiveRecord::Relation, but it
returns an Array if min_id option is present. The behavior caused problems
fixed with the following commits:
- 552e886b64
- b63ede5005
- 64ef37b89d

To prevent from recurring similar problems, this commit introduces two
changes:
- The scope now always returns an Array whether min_id option is present
  or not.
- The scope is renamed to to_a_paginated_by_id to clarify it returns an
  Array.

* Transform Paginable.to_a_paginated_by_id from a scope to a class method

https://api.rubyonrails.org/classes/ActiveRecord/Scoping/Named/ClassMethods.html#method-i-scope
> The method is intended to return an ActiveRecord::Relation object, which
> is composable with other scopes.

Paginable.to_a_paginated_by_id returns an Array and is not appropriate
as a scope.
Eugen Rochko 6c835085a3
Fix timeline pagination ()
Ruby's ** operator does not play well with non-Hash objects, which
the params slice is

Fix 
Eugen Rochko f0fff3eb10
Support min_id-based pagination in REST API ()
* Allow min_id pagination in Feed#get

* Add min_id pagination to home and list timeline APIs

* Add min_id pagination to account statuses, public and tag APIs

* Remove unused stub in reports API

* Use min_id pagination in notifications, favourites, and fix order

* Fix HomeFeed#from_database not using paginate_by_id
Ian McCowan c33931b613 Fix prev/next links on public profile page ()
* Fix prev/next links on public profile page

* Don't make pagination urls if no available statuses

* Fix empty check method

* Put left chevron before prev page link

* Add scope for pagination "starting at" a given id

* Status pagination try 2:

s/prev/older and s/next/newer
"older" on left, "newer" on right
Use new scope for "newer" link
Extract magic 20 page size to constant
Remove max_id from feed pagination as it's not respected

* Reinstate max_id for accounts atom stream

* normalize
Yamagishi Kazutoshi 0a0b9a271a Improve RuboCop rules (compatibility to Code Climate) ()
08f8de84eb/Gemfile.lock (L38)
Code Climate is using RuboCop v0.46.0.

Change several rules to maintain compatibility.
yhirano 3988f2dade Fix Rubocop offences ()
* disable Bundler/OrderedGems

* fix rubocop Lint/UselessAssignment

* fix rubocop Style/BlockDelimiters

* fix rubocop Style/AlignHash

* fix rubocop Style/AlignParameters, Style/EachWithObject

* fix rubocop Style/SpaceInLambdaLiteral
Eugen Rochko fdc17bea58 Fix rubocop issues, introduce usage of frozen literal to improve performance
Eugen Rochko b13e7dda1f API pagination for all collections using Link header
Eugen Rochko b5c6d00afa Fix - public timeline not just reblogs, fix infinite scrolling issues
Eugen Rochko 9fd3d7b6cd Add since_id param to feeds
Eugen Rochko 0f5bbb999c Pre-loading polymorphic associations for Atom feeds