Merge branch 'main' into glitch-soc/merge-upstream
This commit is contained in:
@@ -40,7 +40,7 @@ class Admin::StatusBatchAction
|
||||
end
|
||||
|
||||
def handle_delete!
|
||||
statuses.each { |status| authorize(status, :destroy?) }
|
||||
statuses.each { |status| authorize([:admin, status], :destroy?) }
|
||||
|
||||
ApplicationRecord.transaction do
|
||||
statuses.each do |status|
|
||||
@@ -75,7 +75,7 @@ class Admin::StatusBatchAction
|
||||
statuses.includes(:media_attachments, :preview_cards).find_each do |status|
|
||||
next unless status.with_media? || status.with_preview_card?
|
||||
|
||||
authorize(status, :update?)
|
||||
authorize([:admin, status], :update?)
|
||||
|
||||
if target_account.local?
|
||||
UpdateStatusService.new.call(status, representative_account.id, sensitive: true)
|
||||
|
@@ -3,7 +3,6 @@
|
||||
class Admin::StatusFilter
|
||||
KEYS = %i(
|
||||
media
|
||||
id
|
||||
report_id
|
||||
).freeze
|
||||
|
||||
@@ -28,12 +27,10 @@ class Admin::StatusFilter
|
||||
|
||||
private
|
||||
|
||||
def scope_for(key, value)
|
||||
def scope_for(key, _value)
|
||||
case key.to_s
|
||||
when 'media'
|
||||
Status.joins(:media_attachments).merge(@account.media_attachments.reorder(nil)).group(:id).reorder('statuses.id desc')
|
||||
when 'id'
|
||||
Status.where(id: value)
|
||||
else
|
||||
raise "Unknown filter: #{key}"
|
||||
end
|
||||
|
Reference in New Issue
Block a user