FEATURE: Support [description|attachment](upload://<short-sha>) in MD take 2.

Previous attempt was missing `post_uploads` records.
This commit is contained in:
Guo Xiang Tan
2019-05-29 09:00:25 +08:00
parent 63292cecd9
commit f0620e7118
28 changed files with 605 additions and 308 deletions

View File

@ -101,8 +101,13 @@ module FileStore
end
def path_for(upload)
url = upload.try(:url)
FileStore::LocalStore.new.path_for(upload) if url && url[/^\/[^\/]/]
url = upload&.url
if url && url[/^\/[^\/]/]
FileStore::LocalStore.new.path_for(upload)
else
url
end
end
def cdn_url(url)