From 5646aadfd6fdae413d5b76c38bd81ecad90df98d Mon Sep 17 00:00:00 2001 From: xxq250 Date: Wed, 18 Oct 2023 15:24:39 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20issue=E8=AF=84=E8=AE=BA=E9=87=8C?= =?UTF-8?q?=E7=9A=84=E9=99=84=E4=BB=B6=E8=A7=A3=E6=9E=90=E5=85=B3=E8=81=94?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=BC=BA=E9=99=84=E4=BB=B6=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/journal.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/journal.rb b/app/models/journal.rb index 30cd94143..3229ae886 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -67,7 +67,7 @@ class Journal < ApplicationRecord att_ids += self.notes.to_s.scan(/\/api\/attachments\/.+\"/).map{|s|s.match(/\d+/)[0]} att_ids += self.notes.to_s.scan(/\/api\/attachments\/\d+/).map{|s|s.match(/\d+/)[0]} if att_ids.present? - Attachment.where(id: att_ids).where("container_type IS NULL OR container_type = 'Journal'").update_all(container_id: self.issue.project_id, container_type: "Project") + Attachment.where(id: att_ids).where(container_type: nil).update_all(container_id: self.id, container_type: self.class.name) end end