修复: journal来源解析

This commit is contained in:
yystopf 2024-10-21 11:37:45 +08:00
parent 12c020f315
commit a3ee98125b
1 changed files with 1 additions and 1 deletions

View File

@ -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 "通过<a =\"#{Rails.application.config_for(:configuration)['platform_url']}/#{project&.owner&.login}/#{project&.identifier}/commits/#{commit_sha}\">#{project&.owner&.real_name}/#{project&.name} 提交 #{commit_sha[0...10]}</a>"
return "通过<a href=\"#{Rails.application.config_for(:configuration)['platform_url']}/#{project&.owner&.login}/#{project&.identifier}/commits/#{commit_sha}\">#{project&.owner&.real_name}/#{project&.name} 提交 #{commit_sha[0...10]}</a>"
end
rescue
return ''