mirror of
https://github.com/mastodon/mastodon.git
synced 2025-07-17 17:58:14 +00:00
Compare commits
3 Commits
13ff3f5728
...
4813e7a871
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4813e7a871 | ||
![]() |
74fc4dbacf | ||
![]() |
05d22797b5 |
|
@ -62,7 +62,11 @@ module Admin
|
|||
end
|
||||
|
||||
def set_statuses
|
||||
@statuses = Admin::StatusFilter.new(@account, filter_params).results.preload(:application, :preloadable_poll, :media_attachments, active_mentions: :account, reblog: [:account, :application, :preloadable_poll, :media_attachments, active_mentions: :account]).page(params[:page]).per(PER_PAGE)
|
||||
@statuses = Admin::StatusFilter.new(@account, {}).results.preload(*preload_columns, reblog: [:account, *preload_columns]).page(params[:page]).per(PER_PAGE)
|
||||
end
|
||||
|
||||
def preload_columns
|
||||
[:application, :preloadable_poll, :media_attachments, active_mentions: :account]
|
||||
end
|
||||
|
||||
def filter_params
|
||||
|
|
|
@ -2848,7 +2848,6 @@ a.account__display-name {
|
|||
&__pane {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
pointer-events: none;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
min-width: 285px;
|
||||
|
@ -2860,7 +2859,6 @@ a.account__display-name {
|
|||
&__inner {
|
||||
position: fixed;
|
||||
width: 285px;
|
||||
pointer-events: auto;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,19 @@ class Status < ApplicationRecord
|
|||
include Status::ThreadingConcern
|
||||
include Status::Visibility
|
||||
|
||||
CACHEABLE_ASSOCIATIONS = [
|
||||
:application,
|
||||
:conversation,
|
||||
:media_attachments,
|
||||
:preloadable_poll,
|
||||
:status_stat,
|
||||
:tags,
|
||||
account: [:account_stat, user: :role],
|
||||
active_mentions: :account,
|
||||
preview_cards_status: { preview_card: { author_account: [:account_stat, user: :role] } },
|
||||
quote: { status: { account: [:account_stat, user: :role] } },
|
||||
].freeze
|
||||
|
||||
MEDIA_ATTACHMENTS_LIMIT = 4
|
||||
|
||||
QUOTE_APPROVAL_POLICY_FLAGS = {
|
||||
|
@ -162,29 +175,11 @@ class Status < ApplicationRecord
|
|||
# the `dependent: destroy` callbacks remove relevant records
|
||||
before_destroy :unlink_from_conversations!, prepend: true
|
||||
|
||||
cache_associated :application,
|
||||
:media_attachments,
|
||||
:conversation,
|
||||
:status_stat,
|
||||
:tags,
|
||||
:preloadable_poll,
|
||||
quote: { status: { account: [:account_stat, user: :role] } },
|
||||
preview_cards_status: { preview_card: { author_account: [:account_stat, user: :role] } },
|
||||
account: [:account_stat, user: :role],
|
||||
active_mentions: :account,
|
||||
reblog: [
|
||||
:application,
|
||||
:media_attachments,
|
||||
:conversation,
|
||||
:status_stat,
|
||||
:tags,
|
||||
:preloadable_poll,
|
||||
quote: { status: { account: [:account_stat, user: :role] } },
|
||||
preview_cards_status: { preview_card: { author_account: [:account_stat, user: :role] } },
|
||||
account: [:account_stat, user: :role],
|
||||
active_mentions: :account,
|
||||
],
|
||||
thread: :account
|
||||
cache_associated(
|
||||
*CACHEABLE_ASSOCIATIONS,
|
||||
reblog: [*CACHEABLE_ASSOCIATIONS],
|
||||
thread: :account
|
||||
)
|
||||
|
||||
delegate :domain, :indexable?, to: :account, prefix: true
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user