mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 23:36:11 +08: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
@ -3,7 +3,7 @@
|
||||
require "migration/base_dropper"
|
||||
|
||||
class DbHelper
|
||||
REMAP_SQL ||= <<~SQL
|
||||
REMAP_SQL = <<~SQL
|
||||
SELECT table_name::text, column_name::text, character_maximum_length
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'public'
|
||||
@ -12,13 +12,13 @@ class DbHelper
|
||||
ORDER BY table_name, column_name
|
||||
SQL
|
||||
|
||||
TRIGGERS_SQL ||= <<~SQL
|
||||
TRIGGERS_SQL = <<~SQL
|
||||
SELECT trigger_name::text
|
||||
FROM information_schema.triggers
|
||||
WHERE trigger_name LIKE '%_readonly'
|
||||
SQL
|
||||
|
||||
TRUNCATABLE_COLUMNS ||= ["topic_links.url"]
|
||||
TRUNCATABLE_COLUMNS = ["topic_links.url"]
|
||||
|
||||
def self.remap(
|
||||
from,
|
||||
|
Reference in New Issue
Block a user