A platform for community discussion. Free, open, simple.
DEV: Remove logical OR assignment of constants (#29201)
Alan Guo Xiang Tan322a3be2dbae
diff --git a/app/controllers/admin/themes_controller.rb b/app/controllers/admin/themes_controller.rbindex 5547b13de20..e262230848c 100644--- a/app/controllers/admin/themes_controller.rb+++ b/app/controllers/admin/themes_controller.rb@@ -40,7 +40,7 @@ class Admin::ThemesController < Admin::AdminControllerrender json: { public_key: k.ssh_public_key }end- THEME_CONTENT_TYPES ||= %w[+ THEME_CONTENT_TYPES = %w[application/gzipapplication/x-gzipapplication/x-zip-compresseddiff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rbindex 0b5c46a97ad..94330d14d07 100644--- a/app/controllers/application_controller.rb+++ b/app/controllers/application_controller.rb@@ -56,8 +56,8 @@ class ApplicationController < ActionController::Baseafter_action :clean_xml, if: :is_feed_response?after_action :add_early_hint_header, if: -> { spa_boot_request? }- HONEYPOT_KEY ||= "HONEYPOT_KEY"- CHALLENGE_KEY ||= "CHALLENGE_KEY"+ HONEYPOT_KEY = "HONEYPOT_KEY"+ CHALLENGE_KEY = "CHALLENGE_KEY"layout :set_layoutdiff --git a/app/controllers/extra_locales_controller.rb b/app/controllers/extra_locales_controller.rbindex 7fb4fab9f64..df2768e8099 100644--- a/app/controllers/extra_locales_controller.rb+++ b/app/controllers/extra_locales_controller.rb@@ -9,8 +9,8 @@ class ExtraLocalesController < ApplicationController:redirect_to_profile_if_required,:verify_authenticity_token- OVERRIDES_BUNDLE ||= "overrides"- MD5_HASH_LENGTH ||= 32+ OVERRIDES_BUNDLE = "overrides"+ MD5_HASH_LENGTH = 32MF_BUNDLE = "mf"BUNDLES = [OVERRIDES_BUNDLE, MF_BUNDLE]diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rbindex 81821be4670..fce5dfbcef4 100644--- a/app/controllers/groups_controller.rb+++ b/app/controllers/groups_controller.rb@@ -595,7 +595,7 @@ class GroupsController < ApplicationControllerendend- MAX_NOTIFIED_OWNERS ||= 20+ MAX_NOTIFIED_OWNERS = 20def request_membershipparams.require(:reason)diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rbindex 9953e692cf2..bdd2b68831d 100644--- a/app/controllers/posts_controller.rb+++ b/app/controllers/posts_controller.rb@@ -27,7 +27,7 @@ class PostsController < ApplicationController:check_xhr,only: %i[markdown_id markdown_num short_link latest user_posts_feed]- MARKDOWN_TOPIC_PAGE_SIZE ||= 100+ MARKDOWN_TOPIC_PAGE_SIZE = 100def markdown_idmarkdown Post.find_by(id: params[:id].to_i)@@ -429,7 +429,7 @@ class PostsController < ApplicationControllerrender_json_error(e.message)end- MAX_POST_REPLIES ||= 20+ MAX_POST_REPLIES = 20def repliesparams.permit(:after)diff --git a/app/controllers/presence_controller.rb b/app/controllers/presence_controller.rbindex a4ab2d57e5f..47eace333e8 100644--- a/app/controllers/presence_controller.rb+++ b/app/controllers/presence_controller.rb@@ -5,7 +5,7 @@ class PresenceController < ApplicationControllerbefore_action :ensure_logged_in, only: [:update]before_action :skip_persist_session- MAX_CHANNELS_PER_REQUEST ||= 50+ MAX_CHANNELS_PER_REQUEST = 50def getnames = params.require(:channels)diff --git a/app/controllers/robots_txt_controller.rb b/app/controllers/robots_txt_controller.rbindex 0d7d8ee7cd5..c3498b11644 100644--- a/app/controllers/robots_txt_controller.rb+++ b/app/controllers/robots_txt_controller.rb@@ -10,7 +10,7 @@ class RobotsTxtController < ApplicationControllerOVERRIDDEN_HEADER = "# This robots.txt file has been customized at /admin/customize/robots\n"# NOTE: order is important!- DISALLOWED_PATHS ||= %w[+ DISALLOWED_PATHS = %w[/admin//auth//assets/browser-update*.js@@ -21,7 +21,7 @@ class RobotsTxtController < ApplicationController/*?*api_key*]- DISALLOWED_WITH_HEADER_PATHS ||= %w[/badges /u/ /my /search /tag/*/l /g /t/*/*.rss /c/*.rss]+ DISALLOWED_WITH_HEADER_PATHS = %w[/badges /u/ /my /search /tag/*/l /g /t/*/*.rss /c/*.rss]def indexif (overridden = SiteSetting.overridden_robots_txt.dup).present?diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rbindex 77a53d808a6..1319ae6717d 100644--- a/app/controllers/static_controller.rb+++ b/app/controllers/static_controller.rb@@ -145,7 +145,7 @@ class StaticController < ApplicationControllerredirect_to(destination, allow_other_host: false)end- FAVICON ||= -"favicon"+ FAVICON = -"favicon"# We need to be able to draw our favicon on a canvas, this happens when you enable the feature# that draws the notification count on top of favicon (per user default off)diff --git a/app/controllers/user_api_keys_controller.rb b/app/controllers/user_api_keys_controller.rbindex f1bea047542..792f3000b34 100644--- a/app/controllers/user_api_keys_controller.rb+++ b/app/controllers/user_api_keys_controller.rb@@ -9,7 +9,7 @@ class UserApiKeysController < ApplicationControlleronly: %i[new otp]skip_before_action :check_xhr, :preload_json- AUTH_API_VERSION ||= 4+ AUTH_API_VERSION = 4def newif request.head?diff --git a/app/controllers/users/associate_accounts_controller.rb b/app/controllers/users/associate_accounts_controller.rbindex 371cfbf58c4..393b7ef8bde 100644--- a/app/controllers/users/associate_accounts_controller.rb+++ b/app/controllers/users/associate_accounts_controller.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass Users::AssociateAccountsController < ApplicationController- SECURE_SESSION_PREFIX ||= "omniauth_reconnect"+ SECURE_SESSION_PREFIX = "omniauth_reconnect"before_action :ensure_logged_indiff --git a/app/jobs/regular/export_csv_file.rb b/app/jobs/regular/export_csv_file.rbindex 3d727ad4762..d43b718e318 100644--- a/app/jobs/regular/export_csv_file.rb+++ b/app/jobs/regular/export_csv_file.rb@@ -10,7 +10,7 @@ module Jobsattr_accessor :current_userattr_accessor :entity- HEADER_ATTRS_FOR ||=+ HEADER_ATTRS_FOR =HashWithIndifferentAccess.new(user_list: %w[iddiff --git a/app/jobs/regular/export_user_archive.rb b/app/jobs/regular/export_user_archive.rbindex 56d0315fbaf..1c3a213d87b 100644--- a/app/jobs/regular/export_user_archive.rb+++ b/app/jobs/regular/export_user_archive.rb@@ -10,7 +10,7 @@ module Jobs# note: contents provided entirely by userattr_accessor :extra- COMPONENTS ||= %w[+ COMPONENTS = %w[user_archivepreferencesauth_tokens@@ -25,7 +25,7 @@ module Jobsvisits]- HEADER_ATTRS_FOR ||=+ HEADER_ATTRS_FOR =HashWithIndifferentAccess.new(user_archive: %w[topic_titlediff --git a/app/jobs/regular/user_email.rb b/app/jobs/regular/user_email.rbindex 33fce796304..112057cd790 100644--- a/app/jobs/regular/user_email.rb+++ b/app/jobs/regular/user_email.rb@@ -93,8 +93,7 @@ module Jobs@skip_context = { type: type, user_id: user_id, to_address: to_address, post_id: post_id }end- NOTIFICATIONS_SENT_BY_MAILING_LIST ||=- Set.new %w[posted replied mentioned group_mentioned quoted]+ NOTIFICATIONS_SENT_BY_MAILING_LIST = Set.new %w[posted replied mentioned group_mentioned quoted]def message_for_email(user, post, type, notification, args = nil)args ||= {}diff --git a/app/jobs/scheduled/update_animated_uploads.rb b/app/jobs/scheduled/update_animated_uploads.rbindex 51ea6204a4f..660c8150236 100644--- a/app/jobs/scheduled/update_animated_uploads.rb+++ b/app/jobs/scheduled/update_animated_uploads.rb@@ -4,7 +4,7 @@ module Jobsclass UpdateAnimatedUploads < ::Jobs::Scheduledevery 1.hour- MAX_PROCESSED_GIF_IMAGES ||= 200+ MAX_PROCESSED_GIF_IMAGES = 200def execute(args)Uploaddiff --git a/app/models/admin_dashboard_data.rb b/app/models/admin_dashboard_data.rbindex 8aefd39e301..7b1692024e4 100644--- a/app/models/admin_dashboard_data.rb+++ b/app/models/admin_dashboard_data.rb@@ -6,7 +6,7 @@ class AdminDashboardDatacattr_reader :problem_messages, default: []# kept for backward compatibility- GLOBAL_REPORTS ||= []+ GLOBAL_REPORTS = []PROBLEM_MESSAGE_PREFIX = "admin-problem:"SCHEDULED_PROBLEM_STORAGE_KEY = "admin-found-scheduled-problems-list"diff --git a/app/models/backup_location_site_setting.rb b/app/models/backup_location_site_setting.rbindex 1bdbd2403d6..9c23e0e67aa 100644--- a/app/models/backup_location_site_setting.rb+++ b/app/models/backup_location_site_setting.rb@@ -1,8 +1,8 @@# frozen_string_literal: trueclass BackupLocationSiteSetting < EnumSiteSetting- LOCAL ||= "local"- S3 ||= "s3"+ LOCAL = "local"+ S3 = "s3"def self.valid_value?(val)values.any? { |v| v[:value] == val }diff --git a/app/models/concerns/has_custom_fields.rb b/app/models/concerns/has_custom_fields.rbindex eb0e4a0c7ab..f763b7278c1 100644--- a/app/models/concerns/has_custom_fields.rb+++ b/app/models/concerns/has_custom_fields.rb@@ -4,7 +4,7 @@ module HasCustomFieldsextend ActiveSupport::Concernmodule Helpers- CUSTOM_FIELD_TRUE ||= %w[1 t true T True TRUE].freeze+ CUSTOM_FIELD_TRUE = %w[1 t true T True TRUE].freezeendclass FieldDescriptor < Struct.new(:type, :max_length)diff --git a/app/models/draft.rb b/app/models/draft.rbindex 8e97aaf512a..9ad6016e78a 100644--- a/app/models/draft.rb+++ b/app/models/draft.rb@@ -1,9 +1,9 @@# frozen_string_literal: trueclass Draft < ActiveRecord::Base- NEW_TOPIC ||= "new_topic"- NEW_PRIVATE_MESSAGE ||= "new_private_message"- EXISTING_TOPIC ||= "topic_"+ NEW_TOPIC = "new_topic"+ NEW_PRIVATE_MESSAGE = "new_private_message"+ EXISTING_TOPIC = "topic_"belongs_to :userdiff --git a/app/models/email_log.rb b/app/models/email_log.rbindex c3dc39e0363..1459626ae5b 100644--- a/app/models/email_log.rb+++ b/app/models/email_log.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass EmailLog < ActiveRecord::Base- CRITICAL_EMAIL_TYPES ||=+ CRITICAL_EMAIL_TYPES =Set.new %w[account_createdadmin_logindiff --git a/app/models/emoji.rb b/app/models/emoji.rbindex 867767823cb..e4eb76b4979 100644--- a/app/models/emoji.rb+++ b/app/models/emoji.rb@@ -4,9 +4,9 @@ class Emoji# update this to clear the cacheEMOJI_VERSION = "12"- FITZPATRICK_SCALE ||= %w[1f3fb 1f3fc 1f3fd 1f3fe 1f3ff]+ FITZPATRICK_SCALE = %w[1f3fb 1f3fc 1f3fd 1f3fe 1f3ff]- DEFAULT_GROUP ||= "default"+ DEFAULT_GROUP = "default"include ActiveModel::SerializerSupportdiff --git a/app/models/global_setting.rb b/app/models/global_setting.rbindex e58134e7d75..c143dea6838 100644--- a/app/models/global_setting.rb+++ b/app/models/global_setting.rb@@ -5,12 +5,12 @@ class GlobalSettingdefine_singleton_method(key) { provider.lookup(key, default) }end- VALID_SECRET_KEY ||= /\A[0-9a-f]{128}\z/+ VALID_SECRET_KEY = /\A[0-9a-f]{128}\z/# this is named SECRET_TOKEN as opposed to SECRET_KEY_BASE# for legacy reasons- REDIS_SECRET_KEY ||= "SECRET_TOKEN"+ REDIS_SECRET_KEY = "SECRET_TOKEN"- REDIS_VALIDATE_SECONDS ||= 30+ REDIS_VALIDATE_SECONDS = 30# In Rails secret_key_base is used to encrypt the cookie store# the cookie store contains session datadiff --git a/app/models/imap_sync_log.rb b/app/models/imap_sync_log.rbindex 28f216c4cb2..f5fc0ded5da 100644--- a/app/models/imap_sync_log.rb+++ b/app/models/imap_sync_log.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass ImapSyncLog < ActiveRecord::Base- RETAIN_LOGS_DAYS ||= 5+ RETAIN_LOGS_DAYS = 5belongs_to :groupdiff --git a/app/models/locale_site_setting.rb b/app/models/locale_site_setting.rbindex 8d48568d675..98028dcfcde 100644--- a/app/models/locale_site_setting.rb+++ b/app/models/locale_site_setting.rb@@ -53,7 +53,7 @@ class LocaleSiteSetting < EnumSiteSetting@lock.synchronize { @values = @language_names = @supported_locales = nil }end- FALLBACKS ||= { en_GB: :en }+ FALLBACKS = { en_GB: :en }def self.fallback_locale(locale)fallback_locale = FALLBACKS[locale.to_sym]diff --git a/app/models/optimized_image.rb b/app/models/optimized_image.rbindex b3e390efcd9..36c273fddd2 100644--- a/app/models/optimized_image.rb+++ b/app/models/optimized_image.rb@@ -6,7 +6,7 @@ class OptimizedImage < ActiveRecord::Base# BUMP UP if optimized image algorithm changesVERSION = 2- URL_REGEX ||= %r{(/optimized/\dX[/\.\w]*/([a-zA-Z0-9]+)[\.\w]*)}+ URL_REGEX = %r{(/optimized/\dX[/\.\w]*/([a-zA-Z0-9]+)[\.\w]*)}def self.lock(upload_id, width, height)@hostname ||= Discourse.os_hostname@@ -185,7 +185,7 @@ class OptimizedImage < ActiveRecord::Basepaths.each { |path| raise Discourse::InvalidAccess unless safe_path?(path) }end- IM_DECODERS ||= /\A(jpe?g|png|ico|gif|webp|avif)\z/i+ IM_DECODERS = /\A(jpe?g|png|ico|gif|webp|avif)\z/idef self.prepend_decoder!(path, ext_path = nil, opts = nil)opts ||= {}diff --git a/app/models/post.rb b/app/models/post.rbindex 790338c1e6b..5e86d115364 100644--- a/app/models/post.rb+++ b/app/models/post.rb@@ -77,11 +77,11 @@ class Post < ActiveRecord::Base:skip_unique_check,:skip_validation- MISSING_UPLOADS ||= "missing uploads"- MISSING_UPLOADS_IGNORED ||= "missing uploads ignored"- NOTICE ||= "notice"+ MISSING_UPLOADS = "missing uploads"+ MISSING_UPLOADS_IGNORED = "missing uploads ignored"+ NOTICE = "notice"- SHORT_POST_CHARS ||= 1200+ SHORT_POST_CHARS = 1200register_custom_field_type(MISSING_UPLOADS, :json)register_custom_field_type(MISSING_UPLOADS_IGNORED, :boolean)diff --git a/app/models/remove_muted_tags_from_latest_site_setting.rb b/app/models/remove_muted_tags_from_latest_site_setting.rbindex fb07d94b7a9..4d5be517bf0 100644--- a/app/models/remove_muted_tags_from_latest_site_setting.rb+++ b/app/models/remove_muted_tags_from_latest_site_setting.rb@@ -1,9 +1,9 @@# frozen_string_literal: trueclass RemoveMutedTagsFromLatestSiteSetting < EnumSiteSetting- ALWAYS ||= "always"- ONLY_MUTED ||= "only_muted"- NEVER ||= "never"+ ALWAYS = "always"+ ONLY_MUTED = "only_muted"+ NEVER = "never"def self.valid_value?(val)values.any? { |v| v[:value] == val }diff --git a/app/models/topic.rb b/app/models/topic.rbindex 0e6ecd4c8fb..2f68222495e 100644--- a/app/models/topic.rb+++ b/app/models/topic.rb@@ -697,7 +697,7 @@ class Topic < ActiveRecord::Base!self.closed?end- MAX_SIMILAR_BODY_LENGTH ||= 200+ MAX_SIMILAR_BODY_LENGTH = 200def self.similar_to(title, raw, user = nil)return [] if SiteSetting.max_similar_results == 0@@ -1728,7 +1728,7 @@ class Topic < ActiveRecord::BaseDB.exec(sql, user_id: user.id, topic_id: id) > 0end- TIME_TO_FIRST_RESPONSE_SQL ||= <<-SQL+ TIME_TO_FIRST_RESPONSE_SQL = <<-SQLSELECT AVG(t.hours)::float AS "hours", t.created_at AS "date"FROM (SELECT t.id, t.created_at::date AS created_at, EXTRACT(EPOCH FROM MIN(p.created_at) - t.created_at)::float / 3600.0 AS "hours"@@ -1741,7 +1741,7 @@ class Topic < ActiveRecord::BaseORDER BY t.created_atSQL- TIME_TO_FIRST_RESPONSE_TOTAL_SQL ||= <<-SQL+ TIME_TO_FIRST_RESPONSE_TOTAL_SQL = <<-SQLSELECT AVG(t.hours)::float AS "hours"FROM (SELECT t.id, EXTRACT(EPOCH FROM MIN(p.created_at) - t.created_at)::float / 3600.0 AS "hours"@@ -1787,7 +1787,7 @@ class Topic < ActiveRecord::Basetotal.first["hours"].to_f.round(2)end- WITH_NO_RESPONSE_SQL ||= <<-SQL+ WITH_NO_RESPONSE_SQL = <<-SQLSELECT COUNT(*) as count, tt.created_at AS "date"FROM (SELECT t.id, t.created_at::date AS created_at, MIN(p.post_number) first_reply@@ -1822,7 +1822,7 @@ class Topic < ActiveRecord::Basebuilder.query_hashend- WITH_NO_RESPONSE_TOTAL_SQL ||= <<-SQL+ WITH_NO_RESPONSE_TOTAL_SQL = <<-SQLSELECT COUNT(*) as countFROM (SELECT t.id, MIN(p.post_number) first_replydiff --git a/app/models/user.rb b/app/models/user.rbindex 00e71a234d7..4932dcaddca 100644--- a/app/models/user.rb+++ b/app/models/user.rb@@ -364,7 +364,7 @@ class User < ActiveRecord::BaseLAST_VISIT = -2end- MAX_STAFF_DELETE_POST_COUNT ||= 5+ MAX_STAFF_DELETE_POST_COUNT = 5def self.user_tips@user_tips ||=@@ -1568,7 +1568,7 @@ class User < ActiveRecord::Baseresultend- USER_FIELD_PREFIX ||= "user_field_"+ USER_FIELD_PREFIX = "user_field_"def user_fields(field_ids = nil)field_ids = (@all_user_field_ids ||= UserField.pluck(:id)) if field_ids.nil?@@ -1711,7 +1711,7 @@ class User < ActiveRecord::Base.pluck(:new_email)end- RECENT_TIME_READ_THRESHOLD ||= 60.days+ RECENT_TIME_READ_THRESHOLD = 60.daysdef self.preload_recent_time_read(users)times =diff --git a/app/models/user_search.rb b/app/models/user_search.rbindex 6c8f01286bf..0d2205a6649 100644--- a/app/models/user_search.rb+++ b/app/models/user_search.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass UserSearch- MAX_SIZE_PRIORITY_MENTION ||= 500+ MAX_SIZE_PRIORITY_MENTION = 500def initialize(term, opts = {})@term = term.downcasediff --git a/app/models/user_summary.rb b/app/models/user_summary.rbindex 8156afcc419..311785067b1 100644--- a/app/models/user_summary.rb+++ b/app/models/user_summary.rb@@ -79,7 +79,7 @@ class UserSummaryuser_counts(liked_users)end- REPLY_ACTIONS ||= [UserAction::RESPONSE, UserAction::QUOTE, UserAction::MENTION]+ REPLY_ACTIONS = [UserAction::RESPONSE, UserAction::QUOTE, UserAction::MENTION]def most_replied_to_usersreplied_users = {}diff --git a/app/models/username_validator.rb b/app/models/username_validator.rbindex 20e5262d064..c11c770711e 100644--- a/app/models/username_validator.rb+++ b/app/models/username_validator.rb@@ -40,10 +40,10 @@ class UsernameValidatorerrors.empty?end- CONFUSING_EXTENSIONS ||= /\.(js|json|css|htm|html|xml|jpg|jpeg|png|gif|bmp|ico|tif|tiff|woff)\z/i- MAX_CHARS ||= 60+ CONFUSING_EXTENSIONS = /\.(js|json|css|htm|html|xml|jpg|jpeg|png|gif|bmp|ico|tif|tiff|woff)\z/i+ MAX_CHARS = 60- ASCII_INVALID_CHAR_PATTERN ||= /[^\w.-]/+ ASCII_INVALID_CHAR_PATTERN = /[^\w.-]/# All Unicode characters except for alphabetic and numeric character, marks and underscores are invalid.# In addition to that, the following letters and nonspacing marks are invalid:# (U+034F) Combining Grapheme Joiner@@ -56,7 +56,7 @@ class UsernameValidator# (U+FFA0) Halfwidth Hangul Filler# (U+FE00 - U+FE0F) "Variation Selectors" block# (U+E0100 - U+E01EF) "Variation Selectors Supplement" block- UNICODE_INVALID_CHAR_PATTERN ||=+ UNICODE_INVALID_CHAR_PATTERN =/[^\p{Alnum}\p{M}._-]|[@@ -72,9 +72,9 @@ class UsernameValidator\p{In Variation Selectors Supplement}]/x- INVALID_LEADING_CHAR_PATTERN ||= /\A[^\p{Alnum}\p{M}_]+/- INVALID_TRAILING_CHAR_PATTERN ||= /[^\p{Alnum}\p{M}]+\z/- REPEATED_SPECIAL_CHAR_PATTERN ||= /[-_.]{2,}/+ INVALID_LEADING_CHAR_PATTERN = /\A[^\p{Alnum}\p{M}_]+/+ INVALID_TRAILING_CHAR_PATTERN = /[^\p{Alnum}\p{M}]+\z/+ REPEATED_SPECIAL_CHAR_PATTERN = /[-_.]{2,}/privatediff --git a/app/serializers/post_serializer.rb b/app/serializers/post_serializer.rbindex ebb9f45bb7c..4fe30f814bf 100644--- a/app/serializers/post_serializer.rb+++ b/app/serializers/post_serializer.rb@@ -2,7 +2,7 @@class PostSerializer < BasicPostSerializer# To pass in additional information we might need- INSTANCE_VARS ||= %i[+ INSTANCE_VARS = %i[parent_postadd_rawadd_titlediff --git a/app/services/badge_granter.rb b/app/services/badge_granter.rbindex d8af5a607a7..10acf35603e 100644--- a/app/services/badge_granter.rb+++ b/app/services/badge_granter.rb@@ -379,7 +379,7 @@ class BadgeGranter{ errors: e.message }end- MAX_ITEMS_FOR_DELTA ||= 200+ MAX_ITEMS_FOR_DELTA = 200def self.backfill(badge, opts = nil)return unless SiteSetting.enable_badgesreturn unless badge.enableddiff --git a/app/services/push_notification_pusher.rb b/app/services/push_notification_pusher.rbindex 5ed7f97350f..928181f52be 100644--- a/app/services/push_notification_pusher.rb+++ b/app/services/push_notification_pusher.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass PushNotificationPusher- TOKEN_VALID_FOR_SECONDS ||= 5 * 60+ TOKEN_VALID_FOR_SECONDS = 5 * 60CONNECTION_TIMEOUT_SECONDS = 5def self.push(user, payload)@@ -108,8 +108,8 @@ class PushNotificationPusherendend- MAX_ERRORS ||= 3- MIN_ERROR_DURATION ||= 86_400 # 1 day+ MAX_ERRORS = 3+ MIN_ERROR_DURATION = 86_400 # 1 daydef self.handle_generic_error(subscription, error, user, endpoint, message)subscription.error_count += 1diff --git a/app/services/search_indexer.rb b/app/services/search_indexer.rbindex 1b0aa62e749..9ef1a4b0fcb 100644--- a/app/services/search_indexer.rb+++ b/app/services/search_indexer.rb@@ -405,8 +405,8 @@ class SearchIndexerhtml_scrubber.scrubbed.squishend- MENTION_CLASSES ||= %w[mention mention-group]- ATTRIBUTES ||= %w[alt title href data-video-title]+ MENTION_CLASSES = %w[mention mention-group]+ ATTRIBUTES = %w[alt title href data-video-title]def start_element(_name, attributes = [])attributes = Hash[*attributes.flatten]diff --git a/app/services/staff_action_logger.rb b/app/services/staff_action_logger.rbindex 29e2f241cb4..9bf89155803 100644--- a/app/services/staff_action_logger.rb+++ b/app/services/staff_action_logger.rb@@ -11,7 +11,7 @@ class StaffActionLoggerraise Discourse::InvalidParameters.new(:admin) unless @admin && @admin.is_a?(User)end- USER_FIELDS ||= %i[id username name created_at trust_level last_seen_at last_emailed_at]+ USER_FIELDS = %i[id username name created_at trust_level last_seen_at last_emailed_at]def log_user_deletion(deleted_user, opts = {})unless deleted_user && deleted_user.is_a?(User)@@ -410,7 +410,7 @@ class StaffActionLogger)end- BADGE_FIELDS ||= %i[+ BADGE_FIELDS = %i[idnamedescriptiondiff --git a/app/services/word_watcher.rb b/app/services/word_watcher.rbindex c71706b692f..a0782130e49 100644--- a/app/services/word_watcher.rb+++ b/app/services/word_watcher.rb@@ -1,8 +1,8 @@# frozen_string_literal: trueclass WordWatcher- REPLACEMENT_LETTER ||= CGI.unescape_html("■")- CACHE_VERSION ||= 3+ REPLACEMENT_LETTER = CGI.unescape_html("■")+ CACHE_VERSION = 3def initialize(raw)@raw = rawdiff --git a/db/migrate/20180917024729_remove_superfluous_columns.rb b/db/migrate/20180917024729_remove_superfluous_columns.rbindex cc2f87a31de..734279ca5cf 100644--- a/db/migrate/20180917024729_remove_superfluous_columns.rb+++ b/db/migrate/20180917024729_remove_superfluous_columns.rb@@ -4,7 +4,7 @@ require "migration/column_dropper"require "badge_posts_view_manager"class RemoveSuperfluousColumns < ActiveRecord::Migration[5.2]- DROPPED_COLUMNS ||= {+ DROPPED_COLUMNS = {user_profiles: %i[card_image_badge_id],categories: %i[logo_url background_url suppress_from_homepage],groups: %i[visible public alias_level],diff --git a/db/migrate/20180917034056_remove_superfluous_tables.rb b/db/migrate/20180917034056_remove_superfluous_tables.rbindex 5dfcb8ce95d..409f4878c18 100644--- a/db/migrate/20180917034056_remove_superfluous_tables.rb+++ b/db/migrate/20180917034056_remove_superfluous_tables.rb@@ -3,7 +3,7 @@require "migration/table_dropper"class RemoveSuperfluousTables < ActiveRecord::Migration[5.2]- DROPPED_TABLES ||= %i[category_featured_users versions topic_status_updates]+ DROPPED_TABLES = %i[category_featured_users versions topic_status_updates]def upDROPPED_TABLES.each { |table| Migration::TableDropper.execute_drop(table) }diff --git a/db/migrate/20190103065652_remove_uploaded_meta_id_from_category.rb b/db/migrate/20190103065652_remove_uploaded_meta_id_from_category.rbindex 24c4501dffd..2562072d927 100644--- a/db/migrate/20190103065652_remove_uploaded_meta_id_from_category.rb+++ b/db/migrate/20190103065652_remove_uploaded_meta_id_from_category.rb@@ -3,7 +3,7 @@require "migration/column_dropper"class RemoveUploadedMetaIdFromCategory < ActiveRecord::Migration[5.2]- DROPPED_COLUMNS ||= { categories: %i[uploaded_meta_id] }+ DROPPED_COLUMNS = { categories: %i[uploaded_meta_id] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/migrate/20190312194528_drop_email_user_options_columns.rb b/db/migrate/20190312194528_drop_email_user_options_columns.rbindex 1367ba3871c..37cf3116200 100644--- a/db/migrate/20190312194528_drop_email_user_options_columns.rb+++ b/db/migrate/20190312194528_drop_email_user_options_columns.rb@@ -3,7 +3,7 @@require "migration/column_dropper"class DropEmailUserOptionsColumns < ActiveRecord::Migration[5.2]- DROPPED_COLUMNS ||= { user_options: %i[email_direct email_private_messages email_always] }+ DROPPED_COLUMNS = { user_options: %i[email_direct email_private_messages email_always] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/migrate/20190716124050_remove_via_email_from_invite.rb b/db/migrate/20190716124050_remove_via_email_from_invite.rbindex f0d8b4779dd..93694ac2b15 100644--- a/db/migrate/20190716124050_remove_via_email_from_invite.rb+++ b/db/migrate/20190716124050_remove_via_email_from_invite.rb@@ -3,7 +3,7 @@require "migration/column_dropper"class RemoveViaEmailFromInvite < ActiveRecord::Migration[5.2]- DROPPED_COLUMNS ||= { invites: %i[via_email] }+ DROPPED_COLUMNS = { invites: %i[via_email] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/migrate/20191107190330_remove_suppress_from_latest_from_category.rb b/db/migrate/20191107190330_remove_suppress_from_latest_from_category.rbindex fb836afa632..07ca0e59317 100644--- a/db/migrate/20191107190330_remove_suppress_from_latest_from_category.rb+++ b/db/migrate/20191107190330_remove_suppress_from_latest_from_category.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass RemoveSuppressFromLatestFromCategory < ActiveRecord::Migration[6.0]- DROPPED_COLUMNS ||= { categories: %i[suppress_from_latest] }+ DROPPED_COLUMNS = { categories: %i[suppress_from_latest] }def upids = DB.query_single("SELECT id::text FROM categories WHERE suppress_from_latest = TRUE")diff --git a/db/migrate/20191129144706_drop_unused_google_instagram_auth_tables.rb b/db/migrate/20191129144706_drop_unused_google_instagram_auth_tables.rbindex f6df758fc1a..32b3e660e12 100644--- a/db/migrate/20191129144706_drop_unused_google_instagram_auth_tables.rb+++ b/db/migrate/20191129144706_drop_unused_google_instagram_auth_tables.rb@@ -3,7 +3,7 @@require "migration/table_dropper"class DropUnusedGoogleInstagramAuthTables < ActiveRecord::Migration[6.0]- DROPPED_TABLES ||= %i[google_user_infos instagram_user_infos]+ DROPPED_TABLES = %i[google_user_infos instagram_user_infos]def upDROPPED_TABLES.each { |table| Migration::TableDropper.execute_drop(table) }diff --git a/db/migrate/20191219112000_remove_key_from_api_keys.rb b/db/migrate/20191219112000_remove_key_from_api_keys.rbindex c9dcb70f171..a53f199b084 100644--- a/db/migrate/20191219112000_remove_key_from_api_keys.rb+++ b/db/migrate/20191219112000_remove_key_from_api_keys.rb@@ -1,6 +1,6 @@# frozen_string_literal: trueclass RemoveKeyFromApiKeys < ActiveRecord::Migration[6.0]- DROPPED_COLUMNS ||= { api_keys: %i[key] }+ DROPPED_COLUMNS = { api_keys: %i[key] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/migrate/20200120131338_drop_unused_columns.rb b/db/migrate/20200120131338_drop_unused_columns.rbindex 9e0cd64c712..92ed7ce0c5d 100644--- a/db/migrate/20200120131338_drop_unused_columns.rb+++ b/db/migrate/20200120131338_drop_unused_columns.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropUnusedColumns < ActiveRecord::Migration[6.0]- DROPPED_COLUMNS ||= {+ DROPPED_COLUMNS = {post_replies: %i[reply_id],user_profiles: %i[card_background profile_background],}diff --git a/db/migrate/20200408121312_remove_key_from_user_api_key.rb b/db/migrate/20200408121312_remove_key_from_user_api_key.rbindex e2b0602fb8f..be6a9b78d4f 100644--- a/db/migrate/20200408121312_remove_key_from_user_api_key.rb+++ b/db/migrate/20200408121312_remove_key_from_user_api_key.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass RemoveKeyFromUserApiKey < ActiveRecord::Migration[6.0]- DROPPED_COLUMNS ||= { user_api_keys: %i[key] }+ DROPPED_COLUMNS = { user_api_keys: %i[key] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/migrate/20200415140830_drop_automatic_membership_retroactive_from_group.rb b/db/migrate/20200415140830_drop_automatic_membership_retroactive_from_group.rbindex 23a740aa27d..d6e0f793ead 100644--- a/db/migrate/20200415140830_drop_automatic_membership_retroactive_from_group.rb+++ b/db/migrate/20200415140830_drop_automatic_membership_retroactive_from_group.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropAutomaticMembershipRetroactiveFromGroup < ActiveRecord::Migration[6.0]- DROPPED_COLUMNS ||= { groups: %i[automatic_membership_retroactive] }+ DROPPED_COLUMNS = { groups: %i[automatic_membership_retroactive] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/migrate/20200513185052_drop_topic_reply_count.rb b/db/migrate/20200513185052_drop_topic_reply_count.rbindex 4b5a57f6f7d..a5eb8a36743 100644--- a/db/migrate/20200513185052_drop_topic_reply_count.rb+++ b/db/migrate/20200513185052_drop_topic_reply_count.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropTopicReplyCount < ActiveRecord::Migration[6.0]- DROPPED_COLUMNS ||= { user_stats: %i[topic_reply_count] }+ DROPPED_COLUMNS = { user_stats: %i[topic_reply_count] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/migrate/20200728004302_drop_path_whitelist_from_embeddable_hosts.rb b/db/migrate/20200728004302_drop_path_whitelist_from_embeddable_hosts.rbindex 1a85e38c8eb..c6cc57723d6 100644--- a/db/migrate/20200728004302_drop_path_whitelist_from_embeddable_hosts.rb+++ b/db/migrate/20200728004302_drop_path_whitelist_from_embeddable_hosts.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropPathWhitelistFromEmbeddableHosts < ActiveRecord::Migration[6.0]- DROPPED_COLUMNS ||= { embeddable_hosts: %i[path_whitelist] }+ DROPPED_COLUMNS = { embeddable_hosts: %i[path_whitelist] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/migrate/20210628035905_drop_duration_column_from_topic_timers.rb b/db/migrate/20210628035905_drop_duration_column_from_topic_timers.rbindex dc231c2ca1e..bc6fcad56cd 100644--- a/db/migrate/20210628035905_drop_duration_column_from_topic_timers.rb+++ b/db/migrate/20210628035905_drop_duration_column_from_topic_timers.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropDurationColumnFromTopicTimers < ActiveRecord::Migration[6.1]- DROPPED_COLUMNS ||= { topic_timers: %i[duration] }+ DROPPED_COLUMNS = { topic_timers: %i[duration] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/migrate/20210706091905_drop_disable_jump_reply_column_from_user_options.rb b/db/migrate/20210706091905_drop_disable_jump_reply_column_from_user_options.rbindex 59b105435b5..7e5d2ba08c9 100644--- a/db/migrate/20210706091905_drop_disable_jump_reply_column_from_user_options.rb+++ b/db/migrate/20210706091905_drop_disable_jump_reply_column_from_user_options.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropDisableJumpReplyColumnFromUserOptions < ActiveRecord::Migration[6.1]- DROPPED_COLUMNS ||= { user_options: %i[disable_jump_reply] }+ DROPPED_COLUMNS = { user_options: %i[disable_jump_reply] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/migrate/20210709053030_drop_uploads_verified.rb b/db/migrate/20210709053030_drop_uploads_verified.rbindex 5f999b35197..d007b921c37 100644--- a/db/migrate/20210709053030_drop_uploads_verified.rb+++ b/db/migrate/20210709053030_drop_uploads_verified.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropUploadsVerified < ActiveRecord::Migration[6.1]- DROPPED_COLUMNS ||= { uploads: %i[verified] }+ DROPPED_COLUMNS = { uploads: %i[verified] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/migrate/20211206160212_drop_token_from_email_tokens.rb b/db/migrate/20211206160212_drop_token_from_email_tokens.rbindex f42cd01ddcd..7274d446029 100644--- a/db/migrate/20211206160212_drop_token_from_email_tokens.rb+++ b/db/migrate/20211206160212_drop_token_from_email_tokens.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropTokenFromEmailTokens < ActiveRecord::Migration[6.1]- DROPPED_COLUMNS ||= { email_tokens: %i[token] }+ DROPPED_COLUMNS = { email_tokens: %i[token] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/migrate/20211224010204_drop_old_bookmark_columns.rb b/db/migrate/20211224010204_drop_old_bookmark_columns.rbindex 48793b0f2a0..44e13194ae3 100644--- a/db/migrate/20211224010204_drop_old_bookmark_columns.rb+++ b/db/migrate/20211224010204_drop_old_bookmark_columns.rb@@ -3,7 +3,7 @@require "migration/column_dropper"class DropOldBookmarkColumns < ActiveRecord::Migration[6.1]- DROPPED_COLUMNS ||= { bookmarks: %i[topic_id reminder_type] }+ DROPPED_COLUMNS = { bookmarks: %i[topic_id reminder_type] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/migrate/20220401140745_drop_category_required_tag_group_columns.rb b/db/migrate/20220401140745_drop_category_required_tag_group_columns.rbindex b203db0d17c..9ebeeed7630 100644--- a/db/migrate/20220401140745_drop_category_required_tag_group_columns.rb+++ b/db/migrate/20220401140745_drop_category_required_tag_group_columns.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropCategoryRequiredTagGroupColumns < ActiveRecord::Migration[6.1]- DROPPED_COLUMNS ||= { categories: %i[required_tag_group_id min_tags_from_required_group] }+ DROPPED_COLUMNS = { categories: %i[required_tag_group_id min_tags_from_required_group] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/migrate/20220621164914_drop_flair_url_from_groups.rb b/db/migrate/20220621164914_drop_flair_url_from_groups.rbindex c66cfd036f3..11d23dd2e98 100644--- a/db/migrate/20220621164914_drop_flair_url_from_groups.rb+++ b/db/migrate/20220621164914_drop_flair_url_from_groups.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropFlairUrlFromGroups < ActiveRecord::Migration[7.0]- DROPPED_COLUMNS ||= { groups: %i[flair_url] }+ DROPPED_COLUMNS = { groups: %i[flair_url] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/migrate/20221108032233_drop_old_bookmark_columns_v2.rb b/db/migrate/20221108032233_drop_old_bookmark_columns_v2.rbindex 7860e1546f2..c76bd2f2b17 100644--- a/db/migrate/20221108032233_drop_old_bookmark_columns_v2.rb+++ b/db/migrate/20221108032233_drop_old_bookmark_columns_v2.rb@@ -3,7 +3,7 @@require "migration/column_dropper"class DropOldBookmarkColumnsV2 < ActiveRecord::Migration[7.0]- DROPPED_COLUMNS ||= { bookmarks: %i[post_id for_topic] }+ DROPPED_COLUMNS = { bookmarks: %i[post_id for_topic] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/migrate/20230119024157_remove_topic_count_from_tags.rb b/db/migrate/20230119024157_remove_topic_count_from_tags.rbindex f51e3a1bcd5..2daadcecc00 100644--- a/db/migrate/20230119024157_remove_topic_count_from_tags.rb+++ b/db/migrate/20230119024157_remove_topic_count_from_tags.rb@@ -3,7 +3,7 @@require "migration/column_dropper"class RemoveTopicCountFromTags < ActiveRecord::Migration[7.0]- DROPPED_COLUMNS ||= { tags: %i[topic_count] }+ DROPPED_COLUMNS = { tags: %i[topic_count] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/migrate/20230228105851_drop_badge_granted_title_column.rb b/db/migrate/20230228105851_drop_badge_granted_title_column.rbindex 2a646d850ee..bce21f71268 100644--- a/db/migrate/20230228105851_drop_badge_granted_title_column.rb+++ b/db/migrate/20230228105851_drop_badge_granted_title_column.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropBadgeGrantedTitleColumn < ActiveRecord::Migration[7.0]- DROPPED_COLUMNS ||= { user_profiles: %i[badge_granted_title] }+ DROPPED_COLUMNS = { user_profiles: %i[badge_granted_title] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/migrate/20230926165821_drop_post_uploads_table.rb b/db/migrate/20230926165821_drop_post_uploads_table.rbindex 6d580aadc37..31d34a937fe 100644--- a/db/migrate/20230926165821_drop_post_uploads_table.rb+++ b/db/migrate/20230926165821_drop_post_uploads_table.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropPostUploadsTable < ActiveRecord::Migration[7.0]- DROPPED_TABLES ||= %i[post_uploads]+ DROPPED_TABLES = %i[post_uploads]def upDROPPED_TABLES.each { |table| Migration::TableDropper.execute_drop(table) }diff --git a/db/post_migrate/20240202052058_drop_badge_image_column.rb b/db/post_migrate/20240202052058_drop_badge_image_column.rbindex 20cc8bbedbb..8da554aeac5 100644--- a/db/post_migrate/20240202052058_drop_badge_image_column.rb+++ b/db/post_migrate/20240202052058_drop_badge_image_column.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropBadgeImageColumn < ActiveRecord::Migration[7.0]- DROPPED_COLUMNS ||= { badges: %i[image] }+ DROPPED_COLUMNS = { badges: %i[image] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/post_migrate/20240212034010_drop_deprecated_columns.rb b/db/post_migrate/20240212034010_drop_deprecated_columns.rbindex 0899da200f2..7eecd628351 100644--- a/db/post_migrate/20240212034010_drop_deprecated_columns.rb+++ b/db/post_migrate/20240212034010_drop_deprecated_columns.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass 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],diff --git a/db/post_migrate/20240612073116_swap_field_type_with_field_type_enum_on_user_fields.rb b/db/post_migrate/20240612073116_swap_field_type_with_field_type_enum_on_user_fields.rbindex 8b98bc48c08..0169bf033e0 100644--- a/db/post_migrate/20240612073116_swap_field_type_with_field_type_enum_on_user_fields.rb+++ b/db/post_migrate/20240612073116_swap_field_type_with_field_type_enum_on_user_fields.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass 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 ARdiff --git a/db/post_migrate/20240711123755_drop_compiled_js_from_translation_overrides.rb b/db/post_migrate/20240711123755_drop_compiled_js_from_translation_overrides.rbindex 1476e63cf35..2cd3eb682d1 100644--- a/db/post_migrate/20240711123755_drop_compiled_js_from_translation_overrides.rb+++ b/db/post_migrate/20240711123755_drop_compiled_js_from_translation_overrides.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropCompiledJsFromTranslationOverrides < ActiveRecord::Migration[7.1]- DROPPED_COLUMNS ||= { translation_overrides: %i[compiled_js] }+ DROPPED_COLUMNS = { translation_overrides: %i[compiled_js] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/post_migrate/20240714231516_drop_custom_type_from_flags.rb b/db/post_migrate/20240714231516_drop_custom_type_from_flags.rbindex c2075159f10..3fd3c32afa8 100644--- a/db/post_migrate/20240714231516_drop_custom_type_from_flags.rb+++ b/db/post_migrate/20240714231516_drop_custom_type_from_flags.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropCustomTypeFromFlags < ActiveRecord::Migration[7.0]- DROPPED_COLUMNS ||= { flags: %i[custom_type] }+ DROPPED_COLUMNS = { flags: %i[custom_type] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/db/post_migrate/20240717053710_drop_groups_smtp_ssl.rb b/db/post_migrate/20240717053710_drop_groups_smtp_ssl.rbindex 3c4f2faf830..32f6b14ffd9 100644--- a/db/post_migrate/20240717053710_drop_groups_smtp_ssl.rb+++ b/db/post_migrate/20240717053710_drop_groups_smtp_ssl.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropGroupsSmtpSsl < ActiveRecord::Migration[7.1]- DROPPED_COLUMNS ||= { groups: %i[smtp_ssl] }+ DROPPED_COLUMNS = { groups: %i[smtp_ssl] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/lib/auth/default_current_user_provider.rb b/lib/auth/default_current_user_provider.rbindex 4a23f0b1c48..b8b73608dc2 100644--- a/lib/auth/default_current_user_provider.rb+++ b/lib/auth/default_current_user_provider.rb@@ -23,28 +23,28 @@ require_relative "../route_matcher"# We'll drop support for v0 after Discourse 2.9 is released.class Auth::DefaultCurrentUserProvider- CURRENT_USER_KEY ||= "_DISCOURSE_CURRENT_USER"- USER_TOKEN_KEY ||= "_DISCOURSE_USER_TOKEN"- API_KEY ||= "api_key"- API_USERNAME ||= "api_username"- HEADER_API_KEY ||= "HTTP_API_KEY"- HEADER_API_USERNAME ||= "HTTP_API_USERNAME"- HEADER_API_USER_EXTERNAL_ID ||= "HTTP_API_USER_EXTERNAL_ID"- HEADER_API_USER_ID ||= "HTTP_API_USER_ID"- PARAMETER_USER_API_KEY ||= "user_api_key"- USER_API_KEY ||= "HTTP_USER_API_KEY"- USER_API_CLIENT_ID ||= "HTTP_USER_API_CLIENT_ID"- API_KEY_ENV ||= "_DISCOURSE_API"- USER_API_KEY_ENV ||= "_DISCOURSE_USER_API"- TOKEN_COOKIE ||= ENV["DISCOURSE_TOKEN_COOKIE"] || "_t"- PATH_INFO ||= "PATH_INFO"- COOKIE_ATTEMPTS_PER_MIN ||= 10- BAD_TOKEN ||= "_DISCOURSE_BAD_TOKEN"+ CURRENT_USER_KEY = "_DISCOURSE_CURRENT_USER"+ USER_TOKEN_KEY = "_DISCOURSE_USER_TOKEN"+ API_KEY = "api_key"+ API_USERNAME = "api_username"+ HEADER_API_KEY = "HTTP_API_KEY"+ HEADER_API_USERNAME = "HTTP_API_USERNAME"+ HEADER_API_USER_EXTERNAL_ID = "HTTP_API_USER_EXTERNAL_ID"+ HEADER_API_USER_ID = "HTTP_API_USER_ID"+ PARAMETER_USER_API_KEY = "user_api_key"+ USER_API_KEY = "HTTP_USER_API_KEY"+ USER_API_CLIENT_ID = "HTTP_USER_API_CLIENT_ID"+ API_KEY_ENV = "_DISCOURSE_API"+ USER_API_KEY_ENV = "_DISCOURSE_USER_API"+ TOKEN_COOKIE = ENV["DISCOURSE_TOKEN_COOKIE"] || "_t"+ PATH_INFO = "PATH_INFO"+ COOKIE_ATTEMPTS_PER_MIN = 10+ BAD_TOKEN = "_DISCOURSE_BAD_TOKEN"DECRYPTED_AUTH_COOKIE = "_DISCOURSE_DECRYPTED_AUTH_COOKIE"TOKEN_SIZE = 32- PARAMETER_API_PATTERNS ||= [+ PARAMETER_API_PATTERNS = [RouteMatcher.new(methods: :get,actions: [diff --git a/lib/auth/facebook_authenticator.rb b/lib/auth/facebook_authenticator.rbindex 18924c5fc00..8d7abf55e8b 100644--- a/lib/auth/facebook_authenticator.rb+++ b/lib/auth/facebook_authenticator.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass Auth::FacebookAuthenticator < Auth::ManagedAuthenticator- AVATAR_SIZE ||= 480+ AVATAR_SIZE = 480def name"facebook"diff --git a/lib/auth/google_oauth2_authenticator.rb b/lib/auth/google_oauth2_authenticator.rbindex 3e7c4c4afb6..ac331cd3d84 100644--- a/lib/auth/google_oauth2_authenticator.rb+++ b/lib/auth/google_oauth2_authenticator.rb@@ -1,10 +1,10 @@# frozen_string_literal: trueclass Auth::GoogleOAuth2Authenticator < Auth::ManagedAuthenticator- GROUPS_SCOPE ||= "https://www.googleapis.com/auth/admin.directory.group.readonly"- GROUPS_DOMAIN ||= "admin.googleapis.com"- GROUPS_PATH ||= "/admin/directory/v1/groups"- OAUTH2_BASE_URL ||= "https://oauth2.googleapis.com"+ GROUPS_SCOPE = "https://www.googleapis.com/auth/admin.directory.group.readonly"+ GROUPS_DOMAIN = "admin.googleapis.com"+ GROUPS_PATH = "/admin/directory/v1/groups"+ OAUTH2_BASE_URL = "https://oauth2.googleapis.com"def name"google_oauth2"diff --git a/lib/backup_restore/s3_backup_store.rb b/lib/backup_restore/s3_backup_store.rbindex 492ccaf2344..430d65c5e6a 100644--- a/lib/backup_restore/s3_backup_store.rb+++ b/lib/backup_restore/s3_backup_store.rb@@ -2,7 +2,7 @@module BackupRestoreclass S3BackupStore < BackupStore- UPLOAD_URL_EXPIRES_AFTER_SECONDS ||= 6.hours.to_i+ UPLOAD_URL_EXPIRES_AFTER_SECONDS = 6.hours.to_idelegate :abort_multipart,:presign_multipart_part,diff --git a/lib/db_helper.rb b/lib/db_helper.rbindex db9a9a0df84..3813e6747c4 100644--- a/lib/db_helper.rb+++ b/lib/db_helper.rb@@ -3,7 +3,7 @@require "migration/base_dropper"class DbHelper- REMAP_SQL ||= <<~SQL+ REMAP_SQL = <<~SQLSELECT table_name::text, column_name::text, character_maximum_lengthFROM information_schema.columnsWHERE table_schema = 'public'@@ -12,13 +12,13 @@ class DbHelperORDER BY table_name, column_nameSQL- TRIGGERS_SQL ||= <<~SQL+ TRIGGERS_SQL = <<~SQLSELECT trigger_name::textFROM information_schema.triggersWHERE trigger_name LIKE '%_readonly'SQL- TRUNCATABLE_COLUMNS ||= ["topic_links.url"]+ TRUNCATABLE_COLUMNS = ["topic_links.url"]def self.remap(from,diff --git a/lib/demon/email_sync.rb b/lib/demon/email_sync.rbindex 736f3adfc48..1d6b3c56a09 100644--- a/lib/demon/email_sync.rb+++ b/lib/demon/email_sync.rb@@ -3,8 +3,8 @@require "demon/base"class Demon::EmailSync < ::Demon::Base- HEARTBEAT_KEY ||= "email_sync_heartbeat"- HEARTBEAT_INTERVAL ||= 60.seconds+ HEARTBEAT_KEY = "email_sync_heartbeat"+ HEARTBEAT_INTERVAL = 60.secondsdef self.prefix"email_sync"diff --git a/lib/discourse.rb b/lib/discourse.rbindex 68119a94571..af9e3620d91 100644--- a/lib/discourse.rb+++ b/lib/discourse.rb@@ -7,15 +7,15 @@ require "version"require "git_utils"module Discourse- DB_POST_MIGRATE_PATH ||= "db/post_migrate"- REQUESTED_HOSTNAME ||= "REQUESTED_HOSTNAME"+ DB_POST_MIGRATE_PATH = "db/post_migrate"+ REQUESTED_HOSTNAME = "REQUESTED_HOSTNAME"MAX_METADATA_FILE_SIZE = 64.kilobytesclass Utils- URI_REGEXP ||= URI.regexp(%w[http https])+ URI_REGEXP = URI.regexp(%w[http https])# TODO: Remove this once we drop support for Ruby 2.- EMPTY_KEYWORDS ||= {}+ EMPTY_KEYWORDS = {}# Usage:# Discourse::Utils.execute_command("pwd", chdir: 'mydirectory')@@ -658,17 +658,17 @@ module DiscourseLAST_POSTGRES_READONLY_KEY = "postgres:last_readonly"- READONLY_MODE_KEY_TTL ||= 60- READONLY_MODE_KEY ||= "readonly_mode"- PG_READONLY_MODE_KEY ||= "readonly_mode:postgres"- PG_READONLY_MODE_KEY_TTL ||= 300- USER_READONLY_MODE_KEY ||= "readonly_mode:user"- PG_FORCE_READONLY_MODE_KEY ||= "readonly_mode:postgres_force"+ READONLY_MODE_KEY_TTL = 60+ READONLY_MODE_KEY = "readonly_mode"+ PG_READONLY_MODE_KEY = "readonly_mode:postgres"+ PG_READONLY_MODE_KEY_TTL = 300+ USER_READONLY_MODE_KEY = "readonly_mode:user"+ PG_FORCE_READONLY_MODE_KEY = "readonly_mode:postgres_force"# Pseudo readonly mode, where staff can still write- STAFF_WRITES_ONLY_MODE_KEY ||= "readonly_mode:staff_writes_only"+ STAFF_WRITES_ONLY_MODE_KEY = "readonly_mode:staff_writes_only"- READONLY_KEYS ||= [+ READONLY_KEYS = [READONLY_MODE_KEY,PG_READONLY_MODE_KEY,USER_READONLY_MODE_KEY,diff --git a/lib/discourse_tagging.rb b/lib/discourse_tagging.rbindex 35277fb3054..50101179d6a 100644--- a/lib/discourse_tagging.rb+++ b/lib/discourse_tagging.rb@@ -1,11 +1,11 @@# frozen_string_literal: truemodule DiscourseTagging- TAGS_FIELD_NAME ||= "tags"- TAGS_FILTER_REGEXP ||= /[\/\?#\[\]@!\$&'\(\)\*\+,;=\.%\\`^\s|\{\}"<>]+/ # /?#[]@!$&'()*+,;=.%\`^|{}"<>- TAGS_STAFF_CACHE_KEY ||= "staff_tag_names"+ TAGS_FIELD_NAME = "tags"+ TAGS_FILTER_REGEXP = /[\/\?#\[\]@!\$&'\(\)\*\+,;=\.%\\`^\s|\{\}"<>]+/ # /?#[]@!$&'()*+,;=.%\`^|{}"<>+ TAGS_STAFF_CACHE_KEY = "staff_tag_names"- TAG_GROUP_TAG_IDS_SQL ||= <<-SQL+ TAG_GROUP_TAG_IDS_SQL = <<-SQLSELECT tag_idFROM tag_group_memberships tgmINNER JOIN tag_groups tg@@ -370,7 +370,7 @@ module DiscourseTaggingtags_by_group_map.select { |_, group_tags| group_tags.size > 1 }end- TAG_GROUP_RESTRICTIONS_SQL ||= <<~SQL+ TAG_GROUP_RESTRICTIONS_SQL = <<~SQLtag_group_restrictions AS (SELECT t.id as tag_id, tgm.id as tgm_id, tg.id as tag_group_id, tg.parent_tag_id as parent_tag_id,tg.one_per_topic as one_per_topic@@ -380,7 +380,7 @@ module DiscourseTagging)SQL- CATEGORY_RESTRICTIONS_SQL ||= <<~SQL+ CATEGORY_RESTRICTIONS_SQL = <<~SQLcategory_restrictions AS (SELECT t.id as tag_id, ct.id as ct_id, ct.category_id as category_id, NULL AS category_tag_group_idFROM tags t@@ -395,7 +395,7 @@ module DiscourseTagging)SQL- PERMITTED_TAGS_SQL ||= <<~SQL+ PERMITTED_TAGS_SQL = <<~SQLpermitted_tag_groups AS (SELECT tg.id as tag_group_id, tgp.group_id as group_id, tgp.permission_type as permission_typeFROM tags tdiff --git a/lib/email/receiver.rb b/lib/email/receiver.rbindex 7de0b311538..645722c8324 100644--- a/lib/email/receiver.rb+++ b/lib/email/receiver.rb@@ -95,7 +95,7 @@ module Emailattr_reader :mailattr_reader :message_id- COMMON_ENCODINGS ||= [-"utf-8", -"windows-1252", -"iso-8859-1"]+ COMMON_ENCODINGS = [-"utf-8", -"windows-1252", -"iso-8859-1"]def self.formats@formats ||= Enum.new(plaintext: 1, markdown: 2)@@ -527,7 +527,7 @@ module Email[EmailReplyTrimmer.trim(markdown), elided_markdown]end- HTML_EXTRACTERS ||= [+ HTML_EXTRACTERS = [[:gmail, /class="gmail_(signature|extra)/],[:outlook, /id="(divRplyFwdMsg|Signature)"/],[:word, /class="WordSection1"/],diff --git a/lib/file_store/base_store.rb b/lib/file_store/base_store.rbindex 99e95422cb5..6fea6a402c6 100644--- a/lib/file_store/base_store.rb+++ b/lib/file_store/base_store.rb@@ -5,9 +5,9 @@ module FileStoreendclass BaseStore- UPLOAD_PATH_REGEX ||= %r{/(original/\d+X/.*)}- OPTIMIZED_IMAGE_PATH_REGEX ||= %r{/(optimized/\d+X/.*)}- TEMPORARY_UPLOAD_PREFIX ||= "temp/"+ UPLOAD_PATH_REGEX = %r{/(original/\d+X/.*)}+ OPTIMIZED_IMAGE_PATH_REGEX = %r{/(optimized/\d+X/.*)}+ TEMPORARY_UPLOAD_PREFIX = "temp/"def store_upload(file, upload, content_type = nil)upload.url = nildiff --git a/lib/file_store/s3_store.rb b/lib/file_store/s3_store.rbindex 3c07e462034..f332dc753c5 100644--- a/lib/file_store/s3_store.rb+++ b/lib/file_store/s3_store.rb@@ -8,7 +8,7 @@ require "file_helper"module FileStoreclass S3Store < BaseStore- TOMBSTONE_PREFIX ||= "tombstone/"+ TOMBSTONE_PREFIX = "tombstone/"delegate :abort_multipart,:presign_multipart_part,diff --git a/lib/file_store/to_s3_migration.rb b/lib/file_store/to_s3_migration.rbindex 75b5be278ac..dacfa20b785 100644--- a/lib/file_store/to_s3_migration.rb+++ b/lib/file_store/to_s3_migration.rb@@ -6,8 +6,8 @@ module FileStoreToS3MigrationError = Class.new(RuntimeError)class ToS3Migration- MISSING_UPLOADS_RAKE_TASK_NAME ||= "posts:missing_uploads"- UPLOAD_CONCURRENCY ||= 20+ MISSING_UPLOADS_RAKE_TASK_NAME = "posts:missing_uploads"+ UPLOAD_CONCURRENCY = 20def initialize(s3_options:, dry_run: false, migrate_to_multisite: false)@s3_bucket = s3_options[:bucket]diff --git a/lib/html_to_markdown.rb b/lib/html_to_markdown.rbindex 7ba8bc35bcd..add51e7e1b5 100644--- a/lib/html_to_markdown.rb+++ b/lib/html_to_markdown.rb@@ -157,7 +157,7 @@ class HtmlToMarkdownsend(visitor, node) if respond_to?(visitor, true)end- ALLOWED_IMG_SRCS ||= %w[http:// https:// www.]+ ALLOWED_IMG_SRCS = %w[http:// https:// www.]def allowed_hrefs@allowed_hrefs ||=@@ -195,7 +195,7 @@ class HtmlToMarkdownendend- ALLOWED ||= %w[kbd del ins small big sub sup dl dd dt mark]+ ALLOWED = %w[kbd del ins small big sub sup dl dd dt mark]ALLOWED.each do |tag|define_method("visit_#{tag}") do |node|"<#{tag}>#{traverse(node, within_html_block: true)}</#{tag}>"@@ -210,7 +210,7 @@ class HtmlToMarkdown"\n\n#{text}\n\n"end- BLOCKS ||= %w[div tr]+ BLOCKS = %w[div tr]BLOCKS.each do |tag|define_method("visit_#{tag}") do |node|prefix = block?(node.previous_element) ? "" : "\n"@@ -222,7 +222,7 @@ class HtmlToMarkdown"\n\n#{traverse(node)}\n\n"end- TRAVERSABLES ||= %w[aside font span thead tbody tfoot u center]+ TRAVERSABLES = %w[aside font span thead tbody tfoot u center]TRAVERSABLES.each { |tag| define_method("visit_#{tag}") { |node| traverse(node) } }def visit_tt(node)@@ -290,7 +290,7 @@ class HtmlToMarkdown@within_html_block ? "<tr>\n#{text}</tr>\n" : textend- TABLE_CELLS ||= %w[th td]+ TABLE_CELLS = %w[th td]TABLE_CELLS.each do |tag|define_method("visit_#{tag}") do |node|text = traverse(node)@@ -306,7 +306,7 @@ class HtmlToMarkdownendend- LISTS ||= %w[ul ol]+ LISTS = %w[ul ol]LISTS.each do |tag|define_method("visit_#{tag}") do |node|prefix = block?(node.previous_element) ? "" : "\n"@@ -330,7 +330,7 @@ class HtmlToMarkdown"#{marker}#{text}#{suffix}"end- EMPHASES ||= %w[i em]+ EMPHASES = %w[i em]EMPHASES.each do |tag|define_method("visit_#{tag}") do |node|text = traverse(node)@@ -347,7 +347,7 @@ class HtmlToMarkdownendend- STRONGS ||= %w[b strong]+ STRONGS = %w[b strong]STRONGS.each do |tag|define_method("visit_#{tag}") do |node|text = traverse(node)@@ -364,7 +364,7 @@ class HtmlToMarkdownendend- STRIKES ||= %w[s strike]+ STRIKES = %w[s strike]STRIKES.each do |tag|define_method("visit_#{tag}") do |node|text = traverse(node)diff --git a/lib/migration/base_dropper.rb b/lib/migration/base_dropper.rbindex abf7a39a734..6e43edcb9f0 100644--- a/lib/migration/base_dropper.rb+++ b/lib/migration/base_dropper.rb@@ -2,7 +2,7 @@module Migrationclass BaseDropper- FUNCTION_SCHEMA_NAME ||= "discourse_functions"+ FUNCTION_SCHEMA_NAME = "discourse_functions"def self.create_readonly_function(table_name, column_name = nil)DB.exec <<~SQLdiff --git a/lib/onebox/engine/youtube_onebox.rb b/lib/onebox/engine/youtube_onebox.rbindex 0b6839d012c..8aa9a514802 100644--- a/lib/onebox/engine/youtube_onebox.rb+++ b/lib/onebox/engine/youtube_onebox.rb@@ -10,8 +10,8 @@ module Oneboxrequires_iframe_origins "https://www.youtube.com"always_https- WIDTH ||= 480- HEIGHT ||= 360+ WIDTH = 480+ HEIGHT = 360def parse_embed_responsereturn unless video_iddiff --git a/lib/onebox/helpers.rb b/lib/onebox/helpers.rbindex 8817781f0a5..f80cca5fba3 100644--- a/lib/onebox/helpers.rb+++ b/lib/onebox/helpers.rb@@ -7,7 +7,7 @@ module Oneboxclass DownloadTooLarge < StandardErrorend- IGNORE_CANONICAL_DOMAINS ||= %w[www.instagram.com medium.com youtube.com]+ IGNORE_CANONICAL_DOMAINS = %w[www.instagram.com medium.com youtube.com]def self.clean(html)html.gsub(/<[^>]+>/, " ").gsub(/\n/, "")diff --git a/lib/onebox/preview.rb b/lib/onebox/preview.rbindex 1e387aacd5c..bd0526275dd 100644--- a/lib/onebox/preview.rb+++ b/lib/onebox/preview.rb@@ -5,7 +5,7 @@ module Onebox# see https://bugs.ruby-lang.org/issues/14688client_exception =defined?(Net::HTTPClientException) ? Net::HTTPClientException : Net::HTTPServerException- WEB_EXCEPTIONS ||= [+ WEB_EXCEPTIONS = [client_exception,OpenURI::HTTPError,Timeout::Error,diff --git a/lib/onebox/sanitize_config.rb b/lib/onebox/sanitize_config.rbindex bec61963db1..6753403998d 100644--- a/lib/onebox/sanitize_config.rb+++ b/lib/onebox/sanitize_config.rb@@ -107,7 +107,7 @@ module Onebox),)- DISCOURSE_ONEBOX ||=+ DISCOURSE_ONEBOX =Sanitize::Config.freeze_config(Sanitize::Config.merge(ONEBOX,diff --git a/lib/plain_text_to_markdown.rb b/lib/plain_text_to_markdown.rbindex d914cd867e5..ec332f69292 100644--- a/lib/plain_text_to_markdown.rb+++ b/lib/plain_text_to_markdown.rb@@ -153,9 +153,9 @@ class PlainTextToMarkdownconverted_textend- URL_REGEX ||= URI.regexp(%w[http https ftp mailto])- BEFORE ||= Regexp.escape(%Q|([<«"“'‘|)- AFTER ||= Regexp.escape(%Q|)]>»"”'’|)+ URL_REGEX = URI.regexp(%w[http https ftp mailto])+ BEFORE = Regexp.escape(%Q|([<«"“'‘|)+ AFTER = Regexp.escape(%Q|)]>»"”'’|)def replace_duplicate_links(text)urls = Set.newdiff --git a/lib/plugin/instance.rb b/lib/plugin/instance.rbindex 4f82bbfa187..df16158651a 100644--- a/lib/plugin/instance.rb+++ b/lib/plugin/instance.rb@@ -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_KEYenddiff --git a/lib/plugin/metadata.rb b/lib/plugin/metadata.rbindex 4f6884d8b30..8c26a26b1fc 100644--- a/lib/plugin/metadata.rb+++ b/lib/plugin/metadata.rb@@ -5,7 +5,7 @@ module Pluginendclass 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,diff --git a/lib/presence_channel.rb b/lib/presence_channel.rbindex be07ddca376..128ec24ca07 100644--- a/lib/presence_channel.rb+++ b/lib/presence_channel.rb@@ -42,7 +42,7 @@ class PresenceChannel# allowed_group_ids: array of group_ids that can view, and become present in, the channel (default [])# count_only: boolean. If true, user identities are never revealed to clients. (default [])class Config- NOT_FOUND ||= "notfound"+ NOT_FOUND = "notfound"attr_accessor :public, :allowed_user_ids, :allowed_group_ids, :count_only, :timeout@@ -76,11 +76,11 @@ class PresenceChannelendend- DEFAULT_TIMEOUT ||= 60- CONFIG_CACHE_SECONDS ||= 10- GC_SECONDS ||= 24.hours.to_i- MUTEX_TIMEOUT_SECONDS ||= 10- MUTEX_LOCKED_ERROR ||= "PresenceChannel mutex is locked"+ DEFAULT_TIMEOUT = 60+ CONFIG_CACHE_SECONDS = 10+ GC_SECONDS = 24.hours.to_i+ MUTEX_TIMEOUT_SECONDS = 10+ MUTEX_LOCKED_ERROR = "PresenceChannel mutex is locked"@@configuration_blocks ||= {}@@ -469,7 +469,7 @@ class PresenceChannelendLUA- LUA_SCRIPTS ||= {}+ LUA_SCRIPTS = {}LUA_SCRIPTS[:present] = DiscourseRedis::EvalHelper.new <<~LUA#{COMMON_PRESENT_LEAVE_LUA}diff --git a/lib/route_matcher.rb b/lib/route_matcher.rbindex b8ea48a492b..f2243f8c1cb 100644--- a/lib/route_matcher.rb+++ b/lib/route_matcher.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass RouteMatcher- PATH_PARAMETERS ||= "_DISCOURSE_REQUEST_PATH_PARAMETERS"+ PATH_PARAMETERS = "_DISCOURSE_REQUEST_PATH_PARAMETERS"attr_reader :actions, :params, :methods, :aliases, :formats, :allowed_param_valuesdiff --git a/lib/scheduler/defer.rb b/lib/scheduler/defer.rbindex feb3b1ce3da..995403093a0 100644--- a/lib/scheduler/defer.rb+++ b/lib/scheduler/defer.rb@@ -3,8 +3,8 @@ require "weakref"module Schedulermodule Deferrable- DEFAULT_TIMEOUT ||= 90- STATS_CACHE_SIZE ||= 100+ DEFAULT_TIMEOUT = 90+ STATS_CACHE_SIZE = 100def initialize@async = !Rails.env.test?diff --git a/lib/search.rb b/lib/search.rbindex 05cd3653607..d8557cc3b85 100644--- a/lib/search.rb+++ b/lib/search.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass Search- DIACRITICS ||= /([\u0300-\u036f]|[\u1AB0-\u1AFF]|[\u1DC0-\u1DFF]|[\u20D0-\u20FF])/+ DIACRITICS = /([\u0300-\u036f]|[\u1AB0-\u1AFF]|[\u1DC0-\u1DFF]|[\u20D0-\u20FF])/HIGHLIGHT_CSS_CLASS = "search-highlight"cattr_accessor :preloaded_topic_custom_fieldsdiff --git a/lib/site_setting_extension.rb b/lib/site_setting_extension.rbindex 5971d9cac4d..95b3df4b798 100644--- a/lib/site_setting_extension.rb+++ b/lib/site_setting_extension.rb@@ -438,7 +438,7 @@ module SiteSettingExtensionrefresh_settings.include?(name.to_sym)end- HOSTNAME_SETTINGS ||= %w[+ HOSTNAME_SETTINGS = %w[disabled_image_download_domainsblocked_onebox_domainsexclude_rel_nofollow_domainsdiff --git a/lib/stylesheet/importer.rb b/lib/stylesheet/importer.rbindex daab2cd31a4..6e390a828e3 100644--- a/lib/stylesheet/importer.rb+++ b/lib/stylesheet/importer.rb@@ -6,7 +6,7 @@ module Stylesheetclass Importerinclude GlobalPath- THEME_TARGETS ||= %w[embedded_theme mobile_theme desktop_theme]+ THEME_TARGETS = %w[embedded_theme mobile_theme desktop_theme]def self.plugin_assets@plugin_assets ||= {}diff --git a/lib/stylesheet/manager.rb b/lib/stylesheet/manager.rbindex 04b1de3b696..1ab10790269 100644--- a/lib/stylesheet/manager.rb+++ b/lib/stylesheet/manager.rb@@ -12,9 +12,9 @@ class Stylesheet::ManagerCACHE_PATH = "tmp/stylesheet-cache"private_constant :CACHE_PATH- MANIFEST_DIR ||= "#{Rails.root}/tmp/cache/assets/#{Rails.env}"- THEME_REGEX ||= /_theme\z/- COLOR_SCHEME_STYLESHEET ||= "color_definitions"+ MANIFEST_DIR = "#{Rails.root}/tmp/cache/assets/#{Rails.env}"+ THEME_REGEX = /_theme\z/+ COLOR_SCHEME_STYLESHEET = "color_definitions"@@lock = Mutex.newdiff --git a/lib/text_sentinel.rb b/lib/text_sentinel.rbindex 9ae59fd8c87..2c806733dbf 100644--- a/lib/text_sentinel.rb+++ b/lib/text_sentinel.rb@@ -3,7 +3,7 @@class TextSentinelattr_accessor :text- ENTROPY_SCALE ||= 0.7+ ENTROPY_SCALE = 0.7def initialize(text, opts = nil)@opts = opts || {}diff --git a/lib/upload_creator.rb b/lib/upload_creator.rbindex 3a70dfca6e9..0e823cfc653 100644--- a/lib/upload_creator.rb+++ b/lib/upload_creator.rb@@ -3,9 +3,9 @@require "fastimage"class UploadCreator- TYPES_TO_CROP ||= %w[avatar card_background custom_emoji profile_background].each(&:freeze)+ TYPES_TO_CROP = %w[avatar card_background custom_emoji profile_background].each(&:freeze)- ALLOWED_SVG_ELEMENTS ||= %w[+ ALLOWED_SVG_ELEMENTS = %w[circleclipPathdefs@@ -312,7 +312,7 @@ class UploadCreatorendend- MIN_PIXELS_TO_CONVERT_TO_JPEG ||= 1280 * 720+ MIN_PIXELS_TO_CONVERT_TO_JPEG = 1280 * 720def convert_png_to_jpeg?return false unless @image_info.type == :pngdiff --git a/lib/version.rb b/lib/version.rbindex a5ef84439af..3d0a1bb9629 100644--- a/lib/version.rb+++ b/lib/version.rb@@ -1,8 +1,8 @@# frozen_string_literal: truemodule Discourse- VERSION_REGEXP ||= /\A\d+\.\d+\.\d+(\.beta\d+)?\z/- VERSION_COMPATIBILITY_FILENAME ||= ".discourse-compatibility"+ VERSION_REGEXP = /\A\d+\.\d+\.\d+(\.beta\d+)?\z/+ VERSION_COMPATIBILITY_FILENAME = ".discourse-compatibility"# work around reloaderunless defined?(::Discourse::VERSION)module VERSION #:nodoc:diff --git a/plugins/chat/app/controllers/chat/api/channels_controller.rb b/plugins/chat/app/controllers/chat/api/channels_controller.rbindex 56dc148ec8d..69a0058bf1b 100644--- a/plugins/chat/app/controllers/chat/api/channels_controller.rb+++ b/plugins/chat/app/controllers/chat/api/channels_controller.rb@@ -1,8 +1,8 @@# frozen_string_literal: trueclass Chat::Api::ChannelsController < Chat::ApiController- CHANNEL_EDITABLE_PARAMS ||= %i[name description slug threading_enabled]- CATEGORY_CHANNEL_EDITABLE_PARAMS ||= %i[auto_join_users allow_channel_wide_mentions]+ CHANNEL_EDITABLE_PARAMS = %i[name description slug threading_enabled]+ CATEGORY_CHANNEL_EDITABLE_PARAMS = %i[auto_join_users allow_channel_wide_mentions]def indexpermitted = params.permit(:filter, :limit, :offset, :status)diff --git a/plugins/chat/db/migrate/20220504080457_drop_old_chat_message_post_id_action_code_columns.rb b/plugins/chat/db/migrate/20220504080457_drop_old_chat_message_post_id_action_code_columns.rbindex 6ca1c406b8c..f7ca20bd213 100644--- a/plugins/chat/db/migrate/20220504080457_drop_old_chat_message_post_id_action_code_columns.rb+++ b/plugins/chat/db/migrate/20220504080457_drop_old_chat_message_post_id_action_code_columns.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropOldChatMessagePostIdActionCodeColumns < ActiveRecord::Migration[7.0]- DROPPED_COLUMNS ||= { chat_messages: %i[post_id action_code] }+ DROPPED_COLUMNS = { chat_messages: %i[post_id action_code] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/plugins/chat/db/migrate/20220531105951_drop_user_chat_channel_last_reads.rb b/plugins/chat/db/migrate/20220531105951_drop_user_chat_channel_last_reads.rbindex b746266d85f..5bf3325dcc4 100644--- a/plugins/chat/db/migrate/20220531105951_drop_user_chat_channel_last_reads.rb+++ b/plugins/chat/db/migrate/20220531105951_drop_user_chat_channel_last_reads.rb@@ -5,7 +5,7 @@ require "migration/table_dropper"# usage has been dropped in https://github.com/discourse/discourse-chat/commit/1c110b71b28411dc7ac3ab9e3950e0bbf38d7970# but table never got droppedclass DropUserChatChannelLastReads < ActiveRecord::Migration[7.0]- DROPPED_TABLES ||= %i[user_chat_channel_last_reads]+ DROPPED_TABLES = %i[user_chat_channel_last_reads]def upDROPPED_TABLES.each { |table| Migration::TableDropper.execute_drop(table) }diff --git a/plugins/chat/db/migrate/20220630074200_drop_chat_isolated_from_user_options.rb b/plugins/chat/db/migrate/20220630074200_drop_chat_isolated_from_user_options.rbindex 0a41149418e..2eac0dc2ac1 100644--- a/plugins/chat/db/migrate/20220630074200_drop_chat_isolated_from_user_options.rb+++ b/plugins/chat/db/migrate/20220630074200_drop_chat_isolated_from_user_options.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropChatIsolatedFromUserOptions < ActiveRecord::Migration[7.0]- DROPPED_COLUMNS ||= { user_options: %i[chat_isolated] }+ DROPPED_COLUMNS = { user_options: %i[chat_isolated] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/plugins/chat/db/migrate/20230403012844_drop_chat_uploads.rb b/plugins/chat/db/migrate/20230403012844_drop_chat_uploads.rbindex d36f031e425..d4c689497ef 100644--- a/plugins/chat/db/migrate/20230403012844_drop_chat_uploads.rb+++ b/plugins/chat/db/migrate/20230403012844_drop_chat_uploads.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropChatUploads < ActiveRecord::Migration[7.0]- DROPPED_TABLES ||= %i[chat_uploads]+ DROPPED_TABLES = %i[chat_uploads]def upDROPPED_TABLES.each { |table| Migration::TableDropper.execute_drop(table) }diff --git a/plugins/chat/db/post_migrate/20240408140000_drop_notification_id_from_chat_mentions.rb b/plugins/chat/db/post_migrate/20240408140000_drop_notification_id_from_chat_mentions.rbindex 68fa46820c3..e47b969e3ec 100644--- a/plugins/chat/db/post_migrate/20240408140000_drop_notification_id_from_chat_mentions.rb+++ b/plugins/chat/db/post_migrate/20240408140000_drop_notification_id_from_chat_mentions.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropNotificationIdFromChatMentions < ActiveRecord::Migration[7.0]- DROPPED_COLUMNS ||= { chat_mentions: %i[notification_id] }+ DROPPED_COLUMNS = { chat_mentions: %i[notification_id] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/plugins/chat/db/post_migrate/20240410130000_drop_user_id_from_chat_mentions.rb b/plugins/chat/db/post_migrate/20240410130000_drop_user_id_from_chat_mentions.rbindex d2ca6216f7b..7295a7e1547 100644--- a/plugins/chat/db/post_migrate/20240410130000_drop_user_id_from_chat_mentions.rb+++ b/plugins/chat/db/post_migrate/20240410130000_drop_user_id_from_chat_mentions.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropUserIdFromChatMentions < ActiveRecord::Migration[7.0]- DROPPED_COLUMNS ||= { chat_mentions: %i[user_id] }+ DROPPED_COLUMNS = { chat_mentions: %i[user_id] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/plugins/chat/db/post_migrate/20240425133407_drop_chat_channels_last_message_sent_at.rb b/plugins/chat/db/post_migrate/20240425133407_drop_chat_channels_last_message_sent_at.rbindex 0a3b61d6c98..27ac0598895 100644--- a/plugins/chat/db/post_migrate/20240425133407_drop_chat_channels_last_message_sent_at.rb+++ b/plugins/chat/db/post_migrate/20240425133407_drop_chat_channels_last_message_sent_at.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropChatChannelsLastMessageSentAt < ActiveRecord::Migration[7.0]- DROPPED_COLUMNS ||= { chat_channels: %i[last_message_sent_at] }+ DROPPED_COLUMNS = { chat_channels: %i[last_message_sent_at] }def upDROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }diff --git a/plugins/poll/db/migrate/20180820080623_migrate_polls_data.rb b/plugins/poll/db/migrate/20180820080623_migrate_polls_data.rbindex 3eaa55300fa..9e0bff43212 100644--- a/plugins/poll/db/migrate/20180820080623_migrate_polls_data.rb+++ b/plugins/poll/db/migrate/20180820080623_migrate_polls_data.rb@@ -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_647def up# Ensure we don't have duplicate pollsdiff --git a/plugins/poll/lib/polls_updater.rb b/plugins/poll/lib/polls_updater.rbindex 261e925c712..1b802a70ee5 100644--- a/plugins/poll/lib/polls_updater.rb+++ b/plugins/poll/lib/polls_updater.rb@@ -2,7 +2,7 @@module DiscoursePollclass 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 dodiff --git a/plugins/poll/plugin.rb b/plugins/poll/plugin.rbindex 08ec1e79cb2..40914b47153 100644--- a/plugins/poll/plugin.rb+++ b/plugins/poll/plugin.rb@@ -18,10 +18,10 @@ hide_pluginafter_initialize domodule ::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::Engineengine_name PLUGIN_NAMEdiff --git a/script/bulk_import/base.rb b/script/bulk_import/base.rbindex 25b8b0fbc76..f054eb3fd98 100644--- a/script/bulk_import/base.rb+++ b/script/bulk_import/base.rb@@ -25,8 +25,8 @@ module BulkImportendclass BulkImport::Base- NOW ||= "now()"- PRIVATE_OFFSET ||= 2**30+ NOW = "now()"+ PRIVATE_OFFSET = 2**30CHARSET_MAP = {"armscii8" => nil,@@ -475,7 +475,7 @@ class BulkImport::Base@chat_message_mapping[id.to_s]&.to_iend- GROUP_COLUMNS ||= %i[+ GROUP_COLUMNS = %i[idnamefull_name@@ -490,7 +490,7 @@ class BulkImport::Baseupdated_at]- USER_COLUMNS ||= %i[+ USER_COLUMNS = %i[idusernameusername_lower@@ -511,9 +511,9 @@ class BulkImport::Baseupdated_at]- USER_EMAIL_COLUMNS ||= %i[id user_id email primary created_at updated_at]+ USER_EMAIL_COLUMNS = %i[id user_id email primary created_at updated_at]- USER_STAT_COLUMNS ||= %i[+ USER_STAT_COLUMNS = %i[user_idtopics_enteredtime_read@@ -531,13 +531,13 @@ class BulkImport::Basedigest_attempted_at]- USER_HISTORY_COLUMNS ||= %i[action acting_user_id target_user_id details created_at updated_at]+ USER_HISTORY_COLUMNS = %i[action acting_user_id target_user_id details created_at updated_at]- USER_AVATAR_COLUMNS ||= %i[id user_id custom_upload_id created_at updated_at]+ USER_AVATAR_COLUMNS = %i[id user_id custom_upload_id created_at updated_at]- USER_PROFILE_COLUMNS ||= %i[user_id location website bio_raw bio_cooked views]+ USER_PROFILE_COLUMNS = %i[user_id location website bio_raw bio_cooked views]- USER_SSO_RECORD_COLUMNS ||= %i[+ USER_SSO_RECORD_COLUMNS = %i[iduser_idexternal_id@@ -552,7 +552,7 @@ class BulkImport::Baseexternal_card_background_url]- USER_ASSOCIATED_ACCOUNT_COLUMNS ||= %i[+ USER_ASSOCIATED_ACCOUNT_COLUMNS = %i[provider_nameprovider_uiduser_id@@ -564,7 +564,7 @@ class BulkImport::Baseupdated_at]- USER_OPTION_COLUMNS ||= %i[+ USER_OPTION_COLUMNS = %i[user_idmailing_list_modemailing_list_mode_frequency@@ -590,17 +590,17 @@ class BulkImport::Basetimezone]- USER_FOLLOWER_COLUMNS ||= %i[user_id follower_id level created_at updated_at]+ USER_FOLLOWER_COLUMNS = %i[user_id follower_id level created_at updated_at]- GROUP_USER_COLUMNS ||= %i[group_id user_id created_at updated_at]+ GROUP_USER_COLUMNS = %i[group_id user_id created_at updated_at]- USER_CUSTOM_FIELD_COLUMNS ||= %i[user_id name value created_at updated_at]+ USER_CUSTOM_FIELD_COLUMNS = %i[user_id name value created_at updated_at]- POST_CUSTOM_FIELD_COLUMNS ||= %i[post_id name value created_at updated_at]+ POST_CUSTOM_FIELD_COLUMNS = %i[post_id name value created_at updated_at]- TOPIC_CUSTOM_FIELD_COLUMNS ||= %i[topic_id name value created_at updated_at]+ TOPIC_CUSTOM_FIELD_COLUMNS = %i[topic_id name value created_at updated_at]- USER_ACTION_COLUMNS ||= %i[+ USER_ACTION_COLUMNS = %i[action_typeuser_idtarget_topic_id@@ -611,9 +611,9 @@ class BulkImport::Baseupdated_at]- MUTED_USER_COLUMNS ||= %i[user_id muted_user_id created_at updated_at]+ MUTED_USER_COLUMNS = %i[user_id muted_user_id created_at updated_at]- CATEGORY_COLUMNS ||= %i[+ CATEGORY_COLUMNS = %i[idnamename_lower@@ -628,15 +628,15 @@ class BulkImport::Baseupdated_at]- CATEGORY_CUSTOM_FIELD_COLUMNS ||= %i[category_id name value created_at updated_at]+ CATEGORY_CUSTOM_FIELD_COLUMNS = %i[category_id name value created_at updated_at]- CATEGORY_GROUP_COLUMNS ||= %i[id category_id group_id permission_type created_at updated_at]+ CATEGORY_GROUP_COLUMNS = %i[id category_id group_id permission_type created_at updated_at]- CATEGORY_TAG_GROUP_COLUMNS ||= %i[category_id tag_group_id created_at updated_at]+ CATEGORY_TAG_GROUP_COLUMNS = %i[category_id tag_group_id created_at updated_at]- CATEGORY_USER_COLUMNS ||= %i[category_id user_id notification_level last_seen_at]+ CATEGORY_USER_COLUMNS = %i[category_id user_id notification_level last_seen_at]- TOPIC_COLUMNS ||= %i[+ TOPIC_COLUMNS = %i[idarchetypetitle@@ -657,7 +657,7 @@ class BulkImport::Baseupdated_at]- POST_COLUMNS ||= %i[+ POST_COLUMNS = %i[iduser_idlast_editor_id@@ -675,7 +675,7 @@ class BulkImport::Baseupdated_at]- POST_ACTION_COLUMNS ||= %i[+ POST_ACTION_COLUMNS = %i[idpost_iduser_id@@ -695,13 +695,13 @@ class BulkImport::Basedisagreed_by_id]- TOPIC_ALLOWED_USER_COLUMNS ||= %i[topic_id user_id created_at updated_at]+ TOPIC_ALLOWED_USER_COLUMNS = %i[topic_id user_id created_at updated_at]- TOPIC_ALLOWED_GROUP_COLUMNS ||= %i[topic_id group_id created_at updated_at]+ TOPIC_ALLOWED_GROUP_COLUMNS = %i[topic_id group_id created_at updated_at]- TOPIC_TAG_COLUMNS ||= %i[topic_id tag_id created_at updated_at]+ TOPIC_TAG_COLUMNS = %i[topic_id tag_id created_at updated_at]- TOPIC_USER_COLUMNS ||= %i[+ TOPIC_USER_COLUMNS = %i[user_idtopic_idlast_read_post_number@@ -713,9 +713,9 @@ class BulkImport::Basetotal_msecs_viewed]- TAG_USER_COLUMNS ||= %i[tag_id user_id notification_level created_at updated_at]+ TAG_USER_COLUMNS = %i[tag_id user_id notification_level created_at updated_at]- UPLOAD_COLUMNS ||= %i[+ UPLOAD_COLUMNS = %i[iduser_idoriginal_filename@@ -742,9 +742,9 @@ class BulkImport::Basedominant_color]- UPLOAD_REFERENCE_COLUMNS ||= %i[upload_id target_type target_id created_at updated_at]+ UPLOAD_REFERENCE_COLUMNS = %i[upload_id target_type target_id created_at updated_at]- OPTIMIZED_IMAGE_COLUMNS ||= %i[+ OPTIMIZED_IMAGE_COLUMNS = %i[sha1extensionwidth@@ -758,9 +758,9 @@ class BulkImport::Baseupdated_at]- POST_VOTING_VOTE_COLUMNS ||= %i[user_id votable_type votable_id direction created_at]+ POST_VOTING_VOTE_COLUMNS = %i[user_id votable_type votable_id direction created_at]- BADGE_COLUMNS ||= %i[+ BADGE_COLUMNS = %i[idnamedescription@@ -774,11 +774,11 @@ class BulkImport::Basequery]- USER_BADGE_COLUMNS ||= %i[badge_id user_id granted_at granted_by_id seq post_id created_at]+ USER_BADGE_COLUMNS = %i[badge_id user_id granted_at granted_by_id seq post_id created_at]- GAMIFICATION_SCORE_EVENT_COLUMNS ||= %i[user_id date points description created_at updated_at]+ GAMIFICATION_SCORE_EVENT_COLUMNS = %i[user_id date points description created_at updated_at]- POST_EVENT_COLUMNS ||= %i[+ POST_EVENT_COLUMNS = %i[idstatusoriginal_starts_at@@ -794,7 +794,7 @@ class BulkImport::Baseminimal]- POST_EVENT_DATES_COLUMNS ||= %i[+ POST_EVENT_DATES_COLUMNS = %i[event_idstarts_atends_at@@ -806,7 +806,7 @@ class BulkImport::Baseupdated_at]- POLL_COLUMNS ||= %i[+ POLL_COLUMNS = %i[idpost_idname@@ -826,13 +826,13 @@ class BulkImport::Basetitle]- POLL_OPTION_COLUMNS ||= %i[id poll_id digest html anonymous_votes created_at updated_at]+ POLL_OPTION_COLUMNS = %i[id poll_id digest html anonymous_votes created_at updated_at]- POLL_VOTE_COLUMNS ||= %i[poll_id poll_option_id user_id created_at updated_at]+ POLL_VOTE_COLUMNS = %i[poll_id poll_option_id user_id created_at updated_at]- PLUGIN_STORE_ROW_COLUMNS ||= %i[plugin_name key type_name value]+ PLUGIN_STORE_ROW_COLUMNS = %i[plugin_name key type_name value]- PERMALINK_COLUMNS ||= %i[+ PERMALINK_COLUMNS = %i[urltopic_idpost_id@@ -844,7 +844,7 @@ class BulkImport::Baseupdated_at]- CHAT_DIRECT_MESSAGE_CHANNEL_COLUMNS ||= %i[id group created_at updated_at]+ CHAT_DIRECT_MESSAGE_CHANNEL_COLUMNS = %i[id group created_at updated_at]CHAT_CHANNEL_COLUMNS ||= %i[iddiff --git a/spec/fixtures/db/post_migrate/drop_column/20990309014014_drop_post_columns.rb b/spec/fixtures/db/post_migrate/drop_column/20990309014014_drop_post_columns.rbindex 556489f2553..aff50e6a5dd 100644--- a/spec/fixtures/db/post_migrate/drop_column/20990309014014_drop_post_columns.rb+++ b/spec/fixtures/db/post_migrate/drop_column/20990309014014_drop_post_columns.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropPostColumns < ActiveRecord::Migration[5.2]- DROPPED_COLUMNS ||= { posts: %i[via_email raw_email] }+ DROPPED_COLUMNS = { posts: %i[via_email raw_email] }def upremove_column :posts, :via_emaildiff --git a/spec/fixtures/db/post_migrate/drop_table/20990309014013_drop_email_logs_table.rb b/spec/fixtures/db/post_migrate/drop_table/20990309014013_drop_email_logs_table.rbindex ed8d31d7e64..4a3914c5b2f 100644--- a/spec/fixtures/db/post_migrate/drop_table/20990309014013_drop_email_logs_table.rb+++ b/spec/fixtures/db/post_migrate/drop_table/20990309014013_drop_email_logs_table.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueclass DropEmailLogsTable < ActiveRecord::Migration[5.2]- DROPPED_TABLES ||= %i[email_logs]+ DROPPED_TABLES = %i[email_logs]def updrop_table :email_logs