mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 16:38:48 +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
@ -6,7 +6,8 @@ require "plugin/metadata"
|
||||
require "auth"
|
||||
|
||||
class Plugin::CustomEmoji
|
||||
CACHE_KEY ||= "plugin-emoji"
|
||||
CACHE_KEY = "plugin-emoji"
|
||||
|
||||
def self.cache_key
|
||||
@@cache_key ||= CACHE_KEY
|
||||
end
|
||||
|
@ -5,7 +5,7 @@ module Plugin
|
||||
end
|
||||
|
||||
class Plugin::Metadata
|
||||
OFFICIAL_PLUGINS ||=
|
||||
OFFICIAL_PLUGINS =
|
||||
Set.new(
|
||||
%w[
|
||||
discourse-adplugin
|
||||
@ -97,10 +97,10 @@ class Plugin::Metadata
|
||||
],
|
||||
)
|
||||
|
||||
FIELDS ||= %i[name about version authors contact_emails url required_version meta_topic_id label]
|
||||
FIELDS = %i[name about version authors contact_emails url required_version meta_topic_id label]
|
||||
attr_accessor(*FIELDS)
|
||||
|
||||
MAX_FIELD_LENGTHS ||= {
|
||||
MAX_FIELD_LENGTHS = {
|
||||
name: 75,
|
||||
about: 350,
|
||||
authors: 200,
|
||||
|
Reference in New Issue
Block a user