mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
UX: Lightbox support for image uploader. (#7034)
This commit is contained in:
@ -7,6 +7,8 @@ require_dependency "file_store/local_store"
|
||||
require_dependency "base62"
|
||||
|
||||
class Upload < ActiveRecord::Base
|
||||
include ActionView::Helpers::NumberHelper
|
||||
|
||||
SHA1_LENGTH = 40
|
||||
|
||||
belongs_to :user
|
||||
@ -208,6 +210,10 @@ class Upload < ActiveRecord::Base
|
||||
upload || Upload.find_by("url LIKE ?", "%#{data[1]}")
|
||||
end
|
||||
|
||||
def human_filesize
|
||||
number_to_human_size(self.filesize)
|
||||
end
|
||||
|
||||
def self.migrate_to_new_scheme(limit = nil)
|
||||
problems = []
|
||||
|
||||
|
Reference in New Issue
Block a user