Update rubocop to version 1.8.40 (#37628)

This commit is contained in:
Matt Jankowski
2026-01-29 05:14:14 -05:00
committed by GitHub
parent bc3871f992
commit 23148dc536
12 changed files with 24 additions and 24 deletions

View File

@@ -4,14 +4,14 @@ class RejectFollowingBlockedUsers < ActiveRecord::Migration[5.2]
disable_ddl_transaction!
def up
blocked_follows = Follow.find_by_sql(<<-SQL.squish)
blocked_follows = Follow.find_by_sql(<<~SQL.squish)
select f.* from follows f
inner join blocks b on
f.account_id = b.target_account_id and
f.target_account_id = b.account_id
SQL
domain_blocked_follows = Follow.find_by_sql(<<-SQL.squish)
domain_blocked_follows = Follow.find_by_sql(<<~SQL.squish)
select f.* from follows f
inner join accounts following on f.account_id = following.id
inner join account_domain_blocks b on

View File

@@ -27,7 +27,7 @@ class CopyStatusStats < ActiveRecord::Migration[5.2]
say 'Upsert is available, importing counters using the fast method'
Status.unscoped.select('id').find_in_batches(batch_size: 5_000) do |statuses|
execute <<-SQL.squish
execute <<~SQL.squish
INSERT INTO status_stats (status_id, reblogs_count, favourites_count, created_at, updated_at)
SELECT id, reblogs_count, favourites_count, created_at, updated_at
FROM statuses

View File

@@ -31,7 +31,7 @@ class CopyAccountStats < ActiveRecord::Migration[5.2]
say 'Upsert is available, importing counters using the fast method'
MigrationAccount.unscoped.select('id').find_in_batches(batch_size: 5_000) do |accounts|
execute <<-SQL.squish
execute <<~SQL.squish
INSERT INTO account_stats (account_id, statuses_count, following_count, followers_count, created_at, updated_at)
SELECT id, statuses_count, following_count, followers_count, created_at, updated_at
FROM accounts

View File

@@ -5,7 +5,7 @@ class MigrateCustomFilters < ActiveRecord::Migration[6.1]
# Preserve IDs as much as possible to not confuse existing clients.
# As long as this migration is irreversible, we do not have to deal with conflicts.
safety_assured do
execute <<-SQL.squish
execute <<~SQL.squish
INSERT INTO custom_filter_keywords (id, custom_filter_id, keyword, whole_word, created_at, updated_at)
SELECT id, id, phrase, whole_word, created_at, updated_at
FROM custom_filters
@@ -16,7 +16,7 @@ class MigrateCustomFilters < ActiveRecord::Migration[6.1]
def down
# Copy back changes from custom filters guaranteed to be from the old API
safety_assured do
execute <<-SQL.squish
execute <<~SQL.squish
UPDATE custom_filters
SET phrase = custom_filter_keywords.keyword, whole_word = custom_filter_keywords.whole_word
FROM custom_filter_keywords
@@ -26,7 +26,7 @@ class MigrateCustomFilters < ActiveRecord::Migration[6.1]
# Drop every keyword as we can't safely provide a 1:1 mapping
safety_assured do
execute <<-SQL.squish
execute <<~SQL.squish
TRUNCATE custom_filter_keywords RESTART IDENTITY
SQL
end

View File

@@ -4,7 +4,7 @@ class RemoveBoostsWideningAudience < ActiveRecord::Migration[5.2]
disable_ddl_transaction!
def up
public_boosts = Status.find_by_sql(<<-SQL.squish)
public_boosts = Status.find_by_sql(<<~SQL.squish)
SELECT boost.id
FROM statuses AS boost
LEFT JOIN statuses AS boosted ON boost.reblog_of_id = boosted.id

View File

@@ -7,7 +7,7 @@ class FixCustomFilterKeywordsIdSeq < ActiveRecord::Migration[6.1]
# 20220613110711 manually inserts items with set `id` in the database, but
# we also need to bump the sequence number, otherwise
safety_assured do
execute <<-SQL.squish
execute <<~SQL.squish
BEGIN;
LOCK TABLE custom_filter_keywords IN EXCLUSIVE MODE;
SELECT setval('custom_filter_keywords_id_seq'::regclass, id) FROM custom_filter_keywords ORDER BY id DESC LIMIT 1;