mirror of
https://github.com/discourse/discourse.git
synced 2025-04-19 16:29:05 +08:00
FIX: Use full path for emoji resize job
This commit is contained in:
parent
d8be3e8bb1
commit
9ee67ad89c
@ -66,6 +66,7 @@ class Emoji
|
|||||||
def self.create_for(file, name)
|
def self.create_for(file, name)
|
||||||
extension = File.extname(file.original_filename)
|
extension = File.extname(file.original_filename)
|
||||||
path = "#{Emoji.base_directory}/#{name}#{extension}"
|
path = "#{Emoji.base_directory}/#{name}#{extension}"
|
||||||
|
full_path = "#{Rails.root}/#{path}"
|
||||||
|
|
||||||
# store the emoji
|
# store the emoji
|
||||||
FileUtils.mkdir_p(Pathname.new(path).dirname)
|
FileUtils.mkdir_p(Pathname.new(path).dirname)
|
||||||
@ -73,7 +74,7 @@ class Emoji
|
|||||||
# clear the cache
|
# clear the cache
|
||||||
Emoji.clear_cache
|
Emoji.clear_cache
|
||||||
# launch resize job
|
# launch resize job
|
||||||
Jobs.enqueue(:resize_emoji, path: path)
|
Jobs.enqueue(:resize_emoji, path: full_path)
|
||||||
# return created emoji
|
# return created emoji
|
||||||
Emoji[name]
|
Emoji[name]
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user