UX: Lightbox support for image uploader. (#7034)

This commit is contained in:
Guo Xiang Tan
2019-02-21 10:13:37 +08:00
committed by GitHub
parent 3cb676bf42
commit 58b0e945bd
12 changed files with 160 additions and 55 deletions

View File

@ -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 = []