mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Remove logical OR assignment of constants (#29201)
Constants should always be only assigned once. The logical OR assignment of a constant is a relic of the past before we used zeitwerk for autoloading and had bugs where a file could be loaded twice resulting in constant redefinition warnings.
This commit is contained in:
committed by
GitHub
parent
f3f37c9019
commit
322a3be2db
@@ -1,7 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class DropBadgeImageColumn < ActiveRecord::Migration[7.0]
|
||||
DROPPED_COLUMNS ||= { badges: %i[image] }
|
||||
DROPPED_COLUMNS = { badges: %i[image] }
|
||||
|
||||
def up
|
||||
DROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class DropDeprecatedColumns < ActiveRecord::Migration[7.0]
|
||||
DROPPED_COLUMNS ||= {
|
||||
DROPPED_COLUMNS = {
|
||||
categories: %i[suppress_from_latest required_tag_group_id min_tags_from_required_group],
|
||||
directory_columns: %i[automatic],
|
||||
email_tokens: %i[token],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SwapFieldTypeWithFieldTypeEnumOnUserFields < ActiveRecord::Migration[7.0]
|
||||
# DROPPED_COLUMNS ||= { user_fields: %i[field_type] }
|
||||
# DROPPED_COLUMNS = { user_fields: %i[field_type] }
|
||||
|
||||
# def up
|
||||
# # WARNING: Swapping in a column of a different type in a post-migration will break the AR
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class DropCompiledJsFromTranslationOverrides < ActiveRecord::Migration[7.1]
|
||||
DROPPED_COLUMNS ||= { translation_overrides: %i[compiled_js] }
|
||||
DROPPED_COLUMNS = { translation_overrides: %i[compiled_js] }
|
||||
|
||||
def up
|
||||
DROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class DropCustomTypeFromFlags < ActiveRecord::Migration[7.0]
|
||||
DROPPED_COLUMNS ||= { flags: %i[custom_type] }
|
||||
DROPPED_COLUMNS = { flags: %i[custom_type] }
|
||||
|
||||
def up
|
||||
DROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class DropGroupsSmtpSsl < ActiveRecord::Migration[7.1]
|
||||
DROPPED_COLUMNS ||= { groups: %i[smtp_ssl] }
|
||||
DROPPED_COLUMNS = { groups: %i[smtp_ssl] }
|
||||
|
||||
def up
|
||||
DROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }
|
||||
|
||||
Reference in New Issue
Block a user