Revert "Rails 7 update" (#25667)
This commit is contained in:
parent
5b46345459
commit
ba06a2f104
22 changed files with 144 additions and 242 deletions
|
@ -8,10 +8,7 @@ class BatchedRemoveStatusService < BaseService
|
|||
# @param [Hash] options
|
||||
# @option [Boolean] :skip_side_effects Do not modify feeds and send updates to streaming API
|
||||
def call(statuses, **options)
|
||||
ActiveRecord::Associations::Preloader.new(
|
||||
records: statuses,
|
||||
associations: options[:skip_side_effects] ? :reblogs : [:account, :tags, reblogs: :account]
|
||||
)
|
||||
ActiveRecord::Associations::Preloader.new.preload(statuses, options[:skip_side_effects] ? :reblogs : [:account, :tags, reblogs: :account])
|
||||
|
||||
statuses_and_reblogs = statuses.flat_map { |status| [status] + status.reblogs }
|
||||
|
||||
|
@ -20,10 +17,7 @@ class BatchedRemoveStatusService < BaseService
|
|||
# rely on direct visibility statuses being relatively rare.
|
||||
statuses_with_account_conversations = statuses.select(&:direct_visibility?)
|
||||
|
||||
ActiveRecord::Associations::Preloader.new(
|
||||
records: statuses_with_account_conversations,
|
||||
associations: [mentions: :account]
|
||||
)
|
||||
ActiveRecord::Associations::Preloader.new.preload(statuses_with_account_conversations, [mentions: :account])
|
||||
|
||||
statuses_with_account_conversations.each(&:unlink_from_conversations!)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue