diff --git a/app/models/journal.rb b/app/models/journal.rb index f7f6800dc..8e3af8702 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -88,7 +88,7 @@ class Journal < ApplicationRecord if self.operate_by.starts_with?("Project#") project_id, commit_sha = self.operate_by.scan(/#(\d+).*?@(\w+)/)[0] project =Project.find_by_id(project_id) - return "通过#{project&.owner&.real_name}/#{project&.name}" + return "通过#{project&.owner&.real_name}/#{project&.name} 提交 #{commit_sha[0...10]}" end rescue return '' @@ -165,7 +165,7 @@ class Journal < ApplicationRecord end return content else - return "创建了需求" + content += "创建了需求" end when 'task' case detail.prop_key @@ -225,7 +225,7 @@ class Journal < ApplicationRecord end return content else - return "创建了任务" + content += "创建了任务" end when 'bug' case detail.prop_key @@ -285,14 +285,14 @@ class Journal < ApplicationRecord end return content else - return "创建了缺陷" + content += "创建了缺陷" end when 'attr' case detail.prop_key when 'subject' - return "修改了标题" + content += "修改了标题" when 'description' - return "修改了正文" + content += "修改了正文" when 'priority_id' old_value = IssuePriority.find_by_id(detail.old_value)&.name new_value = IssuePriority.find_by_id(detail.value)&.name @@ -502,13 +502,15 @@ class Journal < ApplicationRecord issue = self.issue case issue.pm_issue_type when 1 - return "创建了需求" + content += "创建了需求" when 2 - return "创建了任务" + content += "创建了任务" when 3 - return "创建了缺陷" + content += "创建了缺陷" end end + + return content end def operate_content @@ -516,7 +518,7 @@ class Journal < ApplicationRecord detail = self.journal_details.take case detail.property when 'issue' - return "创建了疑修" + content += "创建了疑修" when 'attachment' old_value = Attachment.where("BINARY id in (?) or uuid in (?)", detail.old_value.to_s.split(","), detail.old_value.to_s.split(",")).pluck(:filename).join("、") new_value = Attachment.where("BINARY id in (?) or uuid in (?)", detail.value.to_s.split(","), detail.value.to_s.split(",")).pluck(:filename).join("、") @@ -545,12 +547,12 @@ class Journal < ApplicationRecord content += "将负责人由#{old_value}更改为#{new_value}" end when 'attr' - content = "将" + content += "将" case detail.prop_key when 'subject' - return "修改了标题" + content += "修改了标题" when 'description' - return "修改了描述" + content += "修改了描述" when 'status_id' old_value = IssueStatus.find_by_id(detail.old_value)&.name new_value = IssueStatus.find_by_id(detail.value)&.name