Update rubocop to version 1.82.1 (#37475)
This commit is contained in:
parent
c6be114cef
commit
92ad380e11
@ -752,7 +752,7 @@ GEM
|
|||||||
rspec-mocks (~> 3.0)
|
rspec-mocks (~> 3.0)
|
||||||
sidekiq (>= 5, < 9)
|
sidekiq (>= 5, < 9)
|
||||||
rspec-support (3.13.6)
|
rspec-support (3.13.6)
|
||||||
rubocop (1.81.7)
|
rubocop (1.82.1)
|
||||||
json (~> 2.3)
|
json (~> 2.3)
|
||||||
language_server-protocol (~> 3.17.0.2)
|
language_server-protocol (~> 3.17.0.2)
|
||||||
lint_roller (~> 1.1.0)
|
lint_roller (~> 1.1.0)
|
||||||
@ -760,7 +760,7 @@ GEM
|
|||||||
parser (>= 3.3.0.2)
|
parser (>= 3.3.0.2)
|
||||||
rainbow (>= 2.2.2, < 4.0)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
regexp_parser (>= 2.9.3, < 3.0)
|
regexp_parser (>= 2.9.3, < 3.0)
|
||||||
rubocop-ast (>= 1.47.1, < 2.0)
|
rubocop-ast (>= 1.48.0, < 2.0)
|
||||||
ruby-progressbar (~> 1.7)
|
ruby-progressbar (~> 1.7)
|
||||||
unicode-display_width (>= 2.4.0, < 4.0)
|
unicode-display_width (>= 2.4.0, < 4.0)
|
||||||
rubocop-ast (1.49.0)
|
rubocop-ast (1.49.0)
|
||||||
@ -782,7 +782,7 @@ GEM
|
|||||||
rack (>= 1.1)
|
rack (>= 1.1)
|
||||||
rubocop (>= 1.75.0, < 2.0)
|
rubocop (>= 1.75.0, < 2.0)
|
||||||
rubocop-ast (>= 1.44.0, < 2.0)
|
rubocop-ast (>= 1.44.0, < 2.0)
|
||||||
rubocop-rspec (3.8.0)
|
rubocop-rspec (3.9.0)
|
||||||
lint_roller (~> 1.1)
|
lint_roller (~> 1.1)
|
||||||
rubocop (~> 1.81)
|
rubocop (~> 1.81)
|
||||||
rubocop-rspec_rails (2.32.0)
|
rubocop-rspec_rails (2.32.0)
|
||||||
|
|||||||
@ -45,30 +45,34 @@ class MoveWorker
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Then handle accounts that follow both the old and new account
|
# Then handle accounts that follow both the old and new account
|
||||||
@source_account.passive_relationships
|
source_local_followers
|
||||||
.where(account: Account.local)
|
.where(account: @target_account.followers.local)
|
||||||
.where(account: @target_account.followers.local)
|
.in_batches do |follows|
|
||||||
.in_batches do |follows|
|
ListAccount.where(follow: follows).includes(:list).find_each do |list_account|
|
||||||
ListAccount.where(follow: follows).includes(:list).find_each do |list_account|
|
list_account.list.accounts << @target_account
|
||||||
list_account.list.accounts << @target_account
|
rescue ActiveRecord::RecordInvalid
|
||||||
rescue ActiveRecord::RecordInvalid
|
nil
|
||||||
nil
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Finally, handle the common case of accounts not following the new account
|
# Finally, handle the common case of accounts not following the new account
|
||||||
@source_account.passive_relationships
|
source_local_followers
|
||||||
.where(account: Account.local)
|
.where.not(account: @target_account.followers.local)
|
||||||
.where.not(account: @target_account.followers.local)
|
.where.not(account_id: @target_account.id)
|
||||||
.where.not(account_id: @target_account.id)
|
.in_batches do |follows|
|
||||||
.in_batches do |follows|
|
ListAccount.where(follow: follows).in_batches.update_all(account_id: @target_account.id)
|
||||||
ListAccount.where(follow: follows).in_batches.update_all(account_id: @target_account.id)
|
num_moved += follows.update_all(target_account_id: @target_account.id)
|
||||||
num_moved += follows.update_all(target_account_id: @target_account.id)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
num_moved
|
num_moved
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def source_local_followers
|
||||||
|
@source_account
|
||||||
|
.passive_relationships
|
||||||
|
.where(account: Account.local)
|
||||||
|
end
|
||||||
|
|
||||||
def queue_follow_unfollows!
|
def queue_follow_unfollows!
|
||||||
bypass_locked = @target_account.local?
|
bypass_locked = @target_account.local?
|
||||||
|
|
||||||
|
|||||||
@ -16,8 +16,7 @@ module Paperclip
|
|||||||
# if we're processing the original, close + unlink the source tempfile
|
# if we're processing the original, close + unlink the source tempfile
|
||||||
intermediate_files << original if name == :original
|
intermediate_files << original if name == :original
|
||||||
|
|
||||||
@queued_for_write[name] = style.processors
|
@queued_for_write[name] = style.processors.inject(original) do |file, processor|
|
||||||
.inject(original) do |file, processor|
|
|
||||||
file = Paperclip.processor(processor).make(file, style.processor_options, self)
|
file = Paperclip.processor(processor).make(file, style.processor_options, self)
|
||||||
intermediate_files << file unless file == original
|
intermediate_files << file unless file == original
|
||||||
file
|
file
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user