about summary refs log tree commit diff
path: root/app/models/concerns/paginable.rb
AgeCommit message (Collapse)Author
2023-02-18Autofix Rubocop Style/Lambda (#23696)Nick Schonning
2020-09-12allow pagination by min_id and max_id (#14776)tateisu
* 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
2020-08-31Make Array-creation behavior of Paginable more predictable (#14687)Akihiko Odaki
* 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: - 552e886b648faa2a2229d86c7fd9abc8bb5ff99c - b63ede5005d33b52266650ec716d345f166e2df0 - 64ef37b89de806f49cc59e011aa0ee2039c82c46 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.
2018-09-29Fix timeline pagination (#8827)Eugen Rochko
Ruby's ** operator does not play well with non-Hash objects, which the params slice is Fix #8821
2018-09-28Support min_id-based pagination in REST API (#8736)Eugen Rochko
* 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
2018-02-26Fix prev/next links on public profile page (#6497)Ian McCowan
* 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
2017-06-08Improve RuboCop rules (compatibility to Code Climate) (#3636)Yamagishi Kazutoshi
https://github.com/codeclimate/codeclimate-rubocop/blob/08f8de84ebfb39caa96391e23816877278f6441c/Gemfile.lock#L38 Code Climate is using RuboCop v0.46.0. Change several rules to maintain compatibility.
2017-05-01Fix Rubocop offences (#2630)yhirano
* 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
2016-11-15Fix rubocop issues, introduce usage of frozen literal to improve performanceEugen Rochko
2016-11-09API pagination for all collections using Link headerEugen Rochko
2016-10-17Fix #99 - public timeline not just reblogs, fix #98 infinite scrolling issuesEugen Rochko
2016-10-02Add since_id param to feedsEugen Rochko
2016-03-24Pre-loading polymorphic associations for Atom feedsEugen Rochko