fixed 竞赛日志详情

This commit is contained in:
xxq250 2025-10-15 15:21:40 +08:00
parent a8512c7d5e
commit aacd8b96b8
1 changed files with 10 additions and 0 deletions

View File

@ -61,6 +61,7 @@ class UserAction < ApplicationRecord
when "DestroyUser" then "账号:#{user&.login}<br/>邮箱:#{user&.mail}<br/>手机号:#{user&.phone}<br/>昵称:#{user&.nickname}<br/>"
when "DestroyProject" then "项目名称:#{project&.name}<br/>项目标识:#{project&.identifier}<br/>"
when "DestroyOrganization" then "组织名称:#{organization&.nickname}<br/>组织标识:#{organization&.login}<br/>"
when "CompetitionInfoCreate", "CompetitionInfoUpdate", "CompetitionInfoUp", "CompetitionInfoDown" then "竞赛名称:#{competition_info&.title}<br/>竞赛标识:#{competition_info&.identifier}<br/>"
else "--"
end
end
@ -92,6 +93,15 @@ class UserAction < ApplicationRecord
action_organization
end
def competition_info
competition_info = if action_type.include? "CompetitionInfo"
CompetitionInfo.find_by(id: self.action_id)
else
nil
end
competition_info
end
def build_mode(model_name)
model = model_name.constantize.new