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
@@ -5,9 +5,9 @@ class MigratePollsData < ActiveRecord::Migration[5.2]
|
||||
PG::Connection.escape_string(text)
|
||||
end
|
||||
|
||||
POLL_TYPES ||= { "regular" => 0, "multiple" => 1, "number" => 2 }
|
||||
POLL_TYPES = { "regular" => 0, "multiple" => 1, "number" => 2 }
|
||||
|
||||
PG_INTEGER_MAX ||= 2_147_483_647
|
||||
PG_INTEGER_MAX = 2_147_483_647
|
||||
|
||||
def up
|
||||
# Ensure we don't have duplicate polls
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
module DiscoursePoll
|
||||
class PollsUpdater
|
||||
POLL_ATTRIBUTES ||= %w[close_at max min results status step type visibility title groups]
|
||||
POLL_ATTRIBUTES = %w[close_at max min results status step type visibility title groups]
|
||||
|
||||
def self.update(post, polls)
|
||||
::Poll.transaction do
|
||||
|
||||
@@ -18,10 +18,10 @@ hide_plugin
|
||||
|
||||
after_initialize do
|
||||
module ::DiscoursePoll
|
||||
PLUGIN_NAME ||= "poll"
|
||||
DATA_PREFIX ||= "data-poll-"
|
||||
HAS_POLLS ||= "has_polls"
|
||||
DEFAULT_POLL_NAME ||= "poll"
|
||||
PLUGIN_NAME = "poll"
|
||||
DATA_PREFIX = "data-poll-"
|
||||
HAS_POLLS = "has_polls"
|
||||
DEFAULT_POLL_NAME = "poll"
|
||||
|
||||
class Engine < ::Rails::Engine
|
||||
engine_name PLUGIN_NAME
|
||||
|
||||
Reference in New Issue
Block a user