fix: relase attachments

This commit is contained in:
yystopf 2021-09-26 14:42:29 +08:00
parent 46a083239b
commit 24e77300ad
2 changed files with 6 additions and 7 deletions

View File

@ -11,4 +11,9 @@ json.draft re["draft"] ? "草稿" : (re["prerelease"] ? "预发行" : "稳定")
json.created_at format_time(version.created_at.to_s.to_time)
json.published_at format_time(version.created_at.to_s.to_time)
json.user_name user.present? ? user.try(:show_real_name) : ""
json.image_url user.present? ? url_to_avatar(user) : ""
json.image_url user.present? ? url_to_avatar(user) : ""
json.attachments do
json.array! version.try(:attachments) do |attachment|
json.partial! "attachments/attachment_simple", locals: {attachment: attachment}
end
end

View File

@ -13,12 +13,6 @@ json.releases do
json.partial! "version_release", locals: {version: version, user: user, re: re}
end
end
json.attachments do
json.array! version.try(:attachments) do |attachment|
json.partial! "attachments/attachment_simple", locals: {attachment: attachment}
end
end
end
end