mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
fixed 发行版附件关联
This commit is contained in:
@@ -152,11 +152,12 @@ class VersionReleasesController < ApplicationController
|
||||
|
||||
def create_attachments(attachment_ids, target)
|
||||
attachment_ids.each do |id|
|
||||
attachment = Attachment.select(:id, :container_id, :container_type)&.find_by_id(id)
|
||||
attachment = Attachment.select(:id, :container_id, :container_type).where(id: id).or(Attachment.where(uuid: id))&.first
|
||||
unless attachment.blank?
|
||||
attachment.container = target
|
||||
attachment.author_id = current_user.id
|
||||
attachment.description = ""
|
||||
attachment.uuid = SecureRandom.uuid
|
||||
attachment.save
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user