|
|
@ -51,7 +51,9 @@ class ProjectPackages::SaveService
|
|
|
|
package.attachments.where(id: destroy_ids).delete_all
|
|
|
|
package.attachments.where(id: destroy_ids).delete_all
|
|
|
|
|
|
|
|
|
|
|
|
new_ids = attachment_ids - old_attachment_ids
|
|
|
|
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
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def send_create_notify!
|
|
|
|
def send_create_notify!
|
|
|
|