chinwagsocial/app/models
Akihiko Odaki ae871c4d46
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:
- 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.
2020-08-31 12:47:09 +02:00
..
admin
concerns Make Array-creation behavior of Paginable more predictable (#14687) 2020-08-31 12:47:09 +02:00
form
web
account.rb
account_alias.rb
account_conversation.rb Make Array-creation behavior of Paginable more predictable (#14687) 2020-08-31 12:47:09 +02:00
account_domain_block.rb
account_filter.rb Add sorting by username, creation and last activity in moderation view (#13076) 2020-03-08 15:39:13 +01:00
account_identity_proof.rb
account_migration.rb
account_moderation_note.rb
account_note.rb
account_pin.rb
account_stat.rb
account_tag_stat.rb
account_warning.rb
account_warning_preset.rb
admin.rb
announcement.rb
announcement_filter.rb
announcement_mute.rb Add announcements (#12662) 2020-01-23 22:00:13 +01:00
announcement_reaction.rb Add announcements (#12662) 2020-01-23 22:00:13 +01:00
application_record.rb
backup.rb Add announcements (#12662) 2020-01-23 22:00:13 +01:00
block.rb
bookmark.rb
context.rb
conversation.rb
conversation_mute.rb
custom_emoji.rb
custom_emoji_category.rb
custom_emoji_filter.rb
custom_filter.rb
device.rb Add E2EE API (#13820) 2020-06-02 19:24:53 +02:00
domain_allow.rb
domain_block.rb
email_domain_block.rb
encrypted_message.rb Change Redis#exists calls to Redis#exists? to avoid deprecation warning (#14191) 2020-07-01 19:05:21 +02:00
export.rb
favourite.rb
featured_tag.rb
feed.rb
follow.rb
follow_request.rb
home_feed.rb
identity.rb Change identities id column to a bigint (#9371) 2018-11-27 13:56:25 +01:00
import.rb
instance.rb
instance_filter.rb
invite.rb
invite_filter.rb
list.rb
list_account.rb
list_feed.rb
marker.rb Add timeline read markers API (#11762) 2019-09-06 13:55:51 +02:00
media_attachment.rb
mention.rb Improve support for aspects/circles (#8950) 2018-10-17 17:13:04 +02:00
message_franking.rb
mute.rb
notification.rb
one_time_key.rb
poll.rb Only normalize local polls (#12515) 2019-12-01 17:24:33 +01:00
poll_vote.rb
preview_card.rb
relationship_filter.rb
relay.rb Fix enable/disable relay failures (#13535) 2020-04-23 22:04:18 +02:00
remote_follow.rb
report.rb
report_filter.rb
report_note.rb
scheduled_status.rb
search.rb
session_activation.rb
setting.rb
site_upload.rb
status.rb
status_pin.rb Update dependencies for Ruby (2018-04-23) (#7237) 2018-04-23 11:29:17 +02:00
status_stat.rb Reset status cache when status_stat or media_attachment updates (#9119) 2018-10-28 06:42:34 +01:00
system_key.rb Add E2EE API (#13820) 2020-06-02 19:24:53 +02:00
tag.rb Fixes featured hashtag setting page erroring out instead of rejecting invalid tags (#12436) 2019-12-17 13:31:56 +01:00
tag_filter.rb
tombstone.rb
trending_tags.rb
unavailable_domain.rb
user.rb
user_invite_request.rb
web.rb Add extended about page stub 2017-01-13 03:24:41 +01:00
webauthn_credential.rb