mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 20:41:24 +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,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[
|
||||
circle
|
||||
clipPath
|
||||
defs
|
||||
@ -312,7 +312,7 @@ class UploadCreator
|
||||
end
|
||||
end
|
||||
|
||||
MIN_PIXELS_TO_CONVERT_TO_JPEG ||= 1280 * 720
|
||||
MIN_PIXELS_TO_CONVERT_TO_JPEG = 1280 * 720
|
||||
|
||||
def convert_png_to_jpeg?
|
||||
return false unless @image_info.type == :png
|
||||
|
Reference in New Issue
Block a user