add: project category upload logo

This commit is contained in:
2021-10-27 18:02:21 +08:00
parent 274e5090ce
commit 43dc966cf9
7 changed files with 234 additions and 7 deletions

View File

@@ -21,6 +21,14 @@ class ProjectCategory < ApplicationRecord
has_ancestry
def logo_url
""
image_url('logo')
end
private
def image_url(type)
return nil unless Util::FileManage.exists?(self, type)
Util::FileManage.source_disk_file_url(self, type)
end
end