0
0
Fork 0

Autofix Rubocop Style/StringLiterals (#23695)

This commit is contained in:
Nick Schonning 2023-02-18 17:38:14 -05:00 committed by GitHub
parent ac3561098e
commit 81ad6c2e39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
76 changed files with 277 additions and 359 deletions

View file

@ -2,7 +2,7 @@ class AddDeviseToUsers < ActiveRecord::Migration[4.2]
def self.up
change_table(:users) do |t|
## Database authenticatable
t.string :encrypted_password, null: false, default: ""
t.string :encrypted_password, null: false, default: ''
## Recoverable
t.string :reset_password_token

View file

@ -1,7 +1,7 @@
class RemoveUnneededIndexes < ActiveRecord::Migration[5.0]
def change
remove_index :notifications, name: "index_notifications_on_account_id"
remove_index :settings, name: "index_settings_on_target_type_and_target_id"
remove_index :statuses_tags, name: "index_statuses_tags_on_tag_id"
remove_index :notifications, name: 'index_notifications_on_account_id'
remove_index :settings, name: 'index_settings_on_target_type_and_target_id'
remove_index :statuses_tags, name: 'index_statuses_tags_on_tag_id'
end
end

View file

@ -1,5 +1,5 @@
class AddSpoilerTextToStatuses < ActiveRecord::Migration[5.0]
def change
add_column :statuses, :spoiler_text, :text, default: "", null: false
add_column :statuses, :spoiler_text, :text, default: '', null: false
end
end

View file

@ -1,6 +1,6 @@
class RemoveDuplicateIndexesInLists < ActiveRecord::Migration[5.1]
def change
remove_index :list_accounts, name: "index_list_accounts_on_account_id"
remove_index :list_accounts, name: "index_list_accounts_on_list_id"
remove_index :list_accounts, name: 'index_list_accounts_on_account_id'
remove_index :list_accounts, name: 'index_list_accounts_on_list_id'
end
end

View file

@ -5,11 +5,11 @@ class RevertIndexChangeOnStatusesForApiV1AccountsAccountIdStatuses < ActiveRecor
def change
safety_assured do
add_index :statuses, [:account_id, :id, :visibility, :updated_at], order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_20180106 unless index_name_exists?(:statuses, "index_statuses_20180106")
add_index :statuses, [:account_id, :id, :visibility, :updated_at], order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_20180106 unless index_name_exists?(:statuses, 'index_statuses_20180106')
end
# These index may not exists (see migration 20180514130000)
remove_index :statuses, column: [:account_id, :id, :visibility], where: 'visibility IN (0, 1, 2)', algorithm: :concurrently if index_exists?(:statuses, [:account_id, :id, :visibility], where: 'visibility IN (0, 1, 2)')
remove_index :statuses, column: [:account_id, :id], where: 'visibility = 3', algorithm: :concurrently if index_exists?(:statuses, ["account_id", "id"], where: "(visibility = 3)")
remove_index :statuses, column: [:account_id, :id], where: 'visibility = 3', algorithm: :concurrently if index_exists?(:statuses, ['account_id', 'id'], where: '(visibility = 3)')
end
end

View file

@ -1,7 +1,7 @@
class RemoveUnusedIndexes < ActiveRecord::Migration[5.2]
def change
remove_index :statuses, name: "index_statuses_on_conversation_id"
remove_index :users, name: "index_users_on_filtered_languages"
remove_index :backups, name: "index_backups_on_user_id"
remove_index :statuses, name: 'index_statuses_on_conversation_id'
remove_index :users, name: 'index_users_on_filtered_languages'
remove_index :backups, name: 'index_backups_on_user_id'
end
end

View file

@ -6,7 +6,7 @@ class EncryptedMessageIdsToTimestampIds < ActiveRecord::Migration[5.2]
end
def down
execute("LOCK encrypted_messages")
execute('LOCK encrypted_messages')
execute("SELECT setval('encrypted_messages_id_seq', (SELECT MAX(id) FROM encrypted_messages))")
execute("ALTER TABLE encrypted_messages ALTER COLUMN id SET DEFAULT nextval('encrypted_messages_id_seq')")
end

View file

@ -10,7 +10,7 @@ class MediaAttachmentIdsToTimestampIds < ActiveRecord::Migration[5.1]
end
def down
execute("LOCK media_attachments")
execute('LOCK media_attachments')
execute("SELECT setval('media_attachments_id_seq', (SELECT MAX(id) FROM media_attachments))")
execute("ALTER TABLE media_attachments ALTER COLUMN id SET DEFAULT nextval('media_attachments_id_seq')")
end

View file

@ -10,7 +10,7 @@ class AccountIdsToTimestampIds < ActiveRecord::Migration[5.1]
end
def down
execute("LOCK accounts")
execute('LOCK accounts')
execute("SELECT setval('accounts_id_seq', (SELECT MAX(id) FROM accounts))")
execute("ALTER TABLE accounts ALTER COLUMN id SET DEFAULT nextval('accounts_id_seq')")
end