freeze array constants
This commit is contained in:
parent
4b7be137cb
commit
214939bb87
|
@ -21,8 +21,8 @@ class Upload < ActiveRecord::Base
|
||||||
|
|
||||||
validates_with ::Validators::UploadValidator
|
validates_with ::Validators::UploadValidator
|
||||||
|
|
||||||
CROPPED_TYPES ||= %w{avatar card_background custom_emoji profile_background}
|
CROPPED_TYPES ||= %w{avatar card_background custom_emoji profile_background}.each(&:freeze)
|
||||||
UPLOAD_TYPES ||= CROPPED_TYPES + %w{composer}
|
UPLOAD_TYPES ||= CROPPED_TYPES + %w{composer}.each(&:freeze)
|
||||||
|
|
||||||
def thumbnail(width = self.width, height = self.height)
|
def thumbnail(width = self.width, height = self.height)
|
||||||
optimized_images.find_by(width: width, height: height)
|
optimized_images.find_by(width: width, height: height)
|
||||||
|
|
Loading…
Reference in New Issue