fix project package save service

project_pack
p31729568 5 years ago
parent 737e992d04
commit e0cdef3ce9

@ -51,7 +51,9 @@ class ProjectPackages::SaveService
package.attachments.where(id: destroy_ids).delete_all
new_ids = attachment_ids - old_attachment_ids
Attachment.where(id: new_ids).update_all(container_type: package.id, container_type: 'ProjectPackage') if new_ids.present?
if new_ids.present?
Attachment.where(id: new_ids, container_id: nil).update_all(container_id: package.id, container_type: 'ProjectPackage')
end
end
def send_create_notify!

Loading…
Cancel
Save