Update rubocop to version 1.8.40 (#37628)
This commit is contained in:
1 parent
bc3871f992
commit
23148dc536
12 files changed
+24
-24
No files matched your search
@@ -22,7 +22,7 @@ class Admin::Metrics::Dimension::TagServersDimension < Admin::Metrics::Dimension
|
||||
end
|
||||
|
||||
def sql_query_string
|
||||
<<-SQL.squish
|
||||
<<~SQL.squish
|
||||
SELECT accounts.domain, count(*) AS value
|
||||
FROM statuses
|
||||
INNER JOIN accounts ON accounts.id = statuses.account_id
|
||||
|
||||
@@ -49,7 +49,7 @@ module Status::ThreadingConcern
|
||||
end
|
||||
|
||||
def ancestor_statuses(limit)
|
||||
Status.find_by_sql([<<-SQL.squish, id: in_reply_to_id, limit: limit])
|
||||
Status.find_by_sql([<<~SQL.squish, id: in_reply_to_id, limit: limit])
|
||||
WITH RECURSIVE search_tree(id, in_reply_to_id, path)
|
||||
AS (
|
||||
SELECT id, in_reply_to_id, ARRAY[id]
|
||||
@@ -73,7 +73,7 @@ module Status::ThreadingConcern
|
||||
depth += 1 if depth.present?
|
||||
limit += 1 if limit.present?
|
||||
|
||||
descendants_with_self = Status.find_by_sql([<<-SQL.squish, id: id, limit: limit, depth: depth])
|
||||
descendants_with_self = Status.find_by_sql([<<~SQL.squish, id: id, limit: limit, depth: depth])
|
||||
WITH RECURSIVE search_tree(id, path) AS (
|
||||
SELECT id, ARRAY[id]
|
||||
FROM statuses
|
||||
|
||||
@@ -84,7 +84,7 @@ class NotifyService < BaseService
|
||||
# This queries private mentions from the recipient to the sender up in the thread.
|
||||
# This allows up to 100 messages that do not match in the thread, allowing conversations
|
||||
# involving multiple people.
|
||||
Status.count_by_sql([<<-SQL.squish, id: @notification.target_status.in_reply_to_id, recipient_id: @recipient.id, sender_id: @sender.id, depth_limit: 100])
|
||||
Status.count_by_sql([<<~SQL.squish, id: @notification.target_status.in_reply_to_id, recipient_id: @recipient.id, sender_id: @sender.id, depth_limit: 100])
|
||||
WITH RECURSIVE ancestors(id, in_reply_to_id, mention_id, path, depth) AS (
|
||||
SELECT s.id, s.in_reply_to_id, m.id, ARRAY[s.id], 0
|
||||
FROM statuses s
|
||||
|
||||
@@ -48,11 +48,11 @@ class MoveWorker
|
||||
source_local_followers
|
||||
.where(account: @target_account.followers.local)
|
||||
.in_batches do |follows|
|
||||
ListAccount.where(follow: follows).includes(:list).find_each do |list_account|
|
||||
list_account.list.accounts << @target_account
|
||||
rescue ActiveRecord::RecordInvalid
|
||||
nil
|
||||
end
|
||||
ListAccount.where(follow: follows).includes(:list).find_each do |list_account|
|
||||
list_account.list.accounts << @target_account
|
||||
rescue ActiveRecord::RecordInvalid
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
# Finally, handle the common case of accounts not following the new account
|
||||
@@ -60,8 +60,8 @@ class MoveWorker
|
||||
.where.not(account: @target_account.followers.local)
|
||||
.where.not(account_id: @target_account.id)
|
||||
.in_batches do |follows|
|
||||
ListAccount.where(follow: follows).in_batches.update_all(account_id: @target_account.id)
|
||||
num_moved += follows.update_all(target_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)
|
||||
end
|
||||
|
||||
num_moved
|
||||
|
||||
Reference in new issue
Block a user