mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Upload Site Settings. (#6573)
This commit is contained in:
@@ -21,6 +21,7 @@ class Upload < ActiveRecord::Base
|
||||
attr_accessor :for_theme
|
||||
attr_accessor :for_private_message
|
||||
attr_accessor :for_export
|
||||
attr_accessor :for_site_setting
|
||||
|
||||
validates_presence_of :filesize
|
||||
validates_presence_of :original_filename
|
||||
@@ -33,6 +34,10 @@ class Upload < ActiveRecord::Base
|
||||
UserAvatar.where(custom_upload_id: self.id).update_all(custom_upload_id: nil)
|
||||
end
|
||||
|
||||
def to_s
|
||||
self.url
|
||||
end
|
||||
|
||||
def thumbnail(width = self.thumbnail_width, height = self.thumbnail_height)
|
||||
optimized_images.find_by(width: width, height: height)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user