mastodon/app/controllers/api
Akihiko Odaki b096ad1c0f Make Array-creation behavior of Paginable more predictable (#14687)
* 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:
- 976938bf30
- 5a8fa3ad95
- 1c70d8189c

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.
2020-08-31 12:47:09 +02:00
..
v1 Make Array-creation behavior of Paginable more predictable (#14687) 2020-08-31 12:47:09 +02:00
v2 Change local media attachments to perform heavy processing asynchronously (#13210) 2020-03-08 23:56:18 +01:00
web Remove useless `respond_to` calls (#13208) 2020-03-06 01:29:38 +01:00
base_controller.rb Fix functional user requirements in whitelist mode (#14093) 2020-06-19 19:18:47 +02:00
oembed_controller.rb Fix OEmbed leaking information about existence of non-public statuses (#12930) 2020-01-24 00:20:51 +01:00
proofs_controller.rb Fix proofs API being inaccessible in secure mode (#12495) 2019-11-28 04:07:49 +01:00