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 Add E2EE API (#13820) 2020-06-02 19:24:53 +02:00
account_alias.rb Fix confusing error when failing to add an alias to an unknown account (#13480) 2020-04-15 20:33:53 +02:00
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
account_identity_proof.rb Fix Keybase verification using wrong domain for remote accounts (#10547) 2019-04-10 20:28:43 +02:00
account_migration.rb Add (back) option to set redirect notice on account without moving followers (#11994) 2019-09-29 05:03:19 +02:00
account_moderation_note.rb
account_note.rb
account_pin.rb
account_stat.rb
account_tag_stat.rb
account_warning.rb
account_warning_preset.rb Add titles to warning presets in admin UI (#13252) 2020-03-12 17:57:59 +01:00
admin.rb Add logging of admin actions (#5757) 2017-11-24 02:05:53 +01:00
announcement.rb Change delivery failure tracking to work with hostnames instead of URLs (#13437) 2020-04-15 20:33:24 +02:00
announcement_filter.rb
announcement_mute.rb
announcement_reaction.rb Add announcements (#12662) 2020-01-23 22:00:13 +01:00
application_record.rb Fix records not being indexed sometimes (#12024) 2019-10-01 01:19:11 +02:00
backup.rb Add announcements (#12662) 2020-01-23 22:00:13 +01:00
block.rb Store URIs of follows, follow requests and blocks for ActivityPub (#7160) 2018-05-04 21:14:34 +02:00
bookmark.rb
context.rb
conversation.rb
conversation_mute.rb
custom_emoji.rb
custom_emoji_category.rb
custom_emoji_filter.rb Various fixes and improvements (#12878) 2020-01-20 15:55:03 +01:00
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 Export and import show_reblogs together with following list (#10495) 2019-04-08 07:28:27 +02:00
favourite.rb Fix records not being indexed sometimes (#12024) 2019-10-01 01:19:11 +02:00
featured_tag.rb
feed.rb Fix non-numbers being passed to Redis and causing an error (#11697) 2019-08-30 02:49:54 +02:00
follow.rb
follow_request.rb
home_feed.rb
identity.rb
import.rb Fix csv upload (#13835) 2020-05-24 09:15:23 +02:00
instance.rb Add whitelist mode (#11291) 2019-07-30 11:10:46 +02:00
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 Fix videos with near-60 fps being rejected (#14684) 2020-08-30 01:54:30 +02:00
mention.rb Improve support for aspects/circles (#8950) 2018-10-17 17:13:04 +02:00
message_franking.rb
mute.rb Update dependencies for Ruby (2018-04-23) (#7237) 2018-04-23 11:29:17 +02:00
notification.rb
one_time_key.rb Add E2EE API (#13820) 2020-06-02 19:24:53 +02:00
poll.rb
poll_vote.rb Add optimistic lock to avoid race conditions when handling votes (#10196) 2019-03-06 19:53:57 +01:00
preview_card.rb Add blurhash to preview cards (#13984) 2020-06-05 23:10:41 +02:00
relationship_filter.rb
relay.rb Fix enable/disable relay failures (#13535) 2020-04-23 22:04:18 +02:00
remote_follow.rb Refactor monkey-patching of Goldfinger (#12561) 2020-05-10 11:41:43 +02:00
report.rb
report_filter.rb
report_note.rb
scheduled_status.rb Fix deleting a scheduled status immediately deleting media attachments (#9728) 2019-01-06 16:38:40 +01:00
search.rb
session_activation.rb Update dependencies for Ruby (2018-04-23) (#7237) 2018-04-23 11:29:17 +02:00
setting.rb
site_upload.rb Improvements to image upload validation and creation (#10431) 2019-04-01 07:30:46 +02:00
status.rb
status_pin.rb
status_stat.rb
system_key.rb Add E2EE API (#13820) 2020-06-02 19:24:53 +02:00
tag.rb
tag_filter.rb
tombstone.rb
trending_tags.rb
unavailable_domain.rb
user.rb
user_invite_request.rb
web.rb
webauthn_credential.rb Add WebAuthn as an alternative 2FA method (#14466) 2020-08-24 16:46:27 +02:00