Remove default_scope
from MediaAttachment
class (#28043)
This commit is contained in:
parent
02a98210e8
commit
bb0efe16e6
11 changed files with 15 additions and 16 deletions
|
@ -72,7 +72,7 @@ class BackupService < BaseService
|
|||
end
|
||||
|
||||
def dump_media_attachments!(zipfile)
|
||||
MediaAttachment.attached.where(account: account).reorder(nil).find_in_batches do |media_attachments|
|
||||
MediaAttachment.attached.where(account: account).find_in_batches do |media_attachments|
|
||||
media_attachments.each do |m|
|
||||
path = m.file&.path
|
||||
next unless path
|
||||
|
|
|
@ -43,7 +43,7 @@ class ClearDomainMediaService < BaseService
|
|||
end
|
||||
|
||||
def media_from_blocked_domain
|
||||
MediaAttachment.joins(:account).merge(blocked_domain_accounts).reorder(nil)
|
||||
MediaAttachment.joins(:account).merge(blocked_domain_accounts)
|
||||
end
|
||||
|
||||
def emojis_from_blocked_domains
|
||||
|
|
|
@ -165,7 +165,7 @@ class DeleteAccountService < BaseService
|
|||
end
|
||||
|
||||
def purge_media_attachments!
|
||||
@account.media_attachments.reorder(nil).find_each do |media_attachment|
|
||||
@account.media_attachments.find_each do |media_attachment|
|
||||
next if keep_account_record? && reported_status_ids.include?(media_attachment.status_id)
|
||||
|
||||
media_attachment.destroy
|
||||
|
|
|
@ -65,7 +65,7 @@ class SuspendAccountService < BaseService
|
|||
def privatize_media_attachments!
|
||||
attachment_names = MediaAttachment.attachment_definitions.keys
|
||||
|
||||
@account.media_attachments.reorder(nil).find_each do |media_attachment|
|
||||
@account.media_attachments.find_each do |media_attachment|
|
||||
attachment_names.each do |attachment_name|
|
||||
attachment = media_attachment.public_send(attachment_name)
|
||||
styles = MediaAttachment::DEFAULT_STYLES | attachment.styles.keys
|
||||
|
|
|
@ -61,7 +61,7 @@ class UnsuspendAccountService < BaseService
|
|||
def publish_media_attachments!
|
||||
attachment_names = MediaAttachment.attachment_definitions.keys
|
||||
|
||||
@account.media_attachments.reorder(nil).find_each do |media_attachment|
|
||||
@account.media_attachments.find_each do |media_attachment|
|
||||
attachment_names.each do |attachment_name|
|
||||
attachment = media_attachment.public_send(attachment_name)
|
||||
styles = MediaAttachment::DEFAULT_STYLES | attachment.styles.keys
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue