Browse Source

fix: relase attachments

tags/v3.2.0
yystopf 4 years ago
parent
commit
24e77300ad
2 changed files with 6 additions and 7 deletions
  1. +6
    -1
      app/views/version_releases/_version_release.json.jbuilder
  2. +0
    -6
      app/views/version_releases/index.json.jbuilder

+ 6
- 1
app/views/version_releases/_version_release.json.jbuilder 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

+ 0
- 6
app/views/version_releases/index.json.jbuilder 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


Loading…
Cancel
Save