From aacd8b96b8b08ebc9ed15cbac02c60825ca653bd Mon Sep 17 00:00:00 2001 From: xxq250 Date: Wed, 15 Oct 2025 15:21:40 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E7=AB=9E=E8=B5=9B=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/user_action.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/models/user_action.rb b/app/models/user_action.rb index 0cd4e5b86..dd5dde4ac 100644 --- a/app/models/user_action.rb +++ b/app/models/user_action.rb @@ -61,6 +61,7 @@ class UserAction < ApplicationRecord when "DestroyUser" then "账号:#{user&.login}
邮箱:#{user&.mail}
手机号:#{user&.phone}
昵称:#{user&.nickname}
" when "DestroyProject" then "项目名称:#{project&.name}
项目标识:#{project&.identifier}
" when "DestroyOrganization" then "组织名称:#{organization&.nickname}
组织标识:#{organization&.login}
" + when "CompetitionInfoCreate", "CompetitionInfoUpdate", "CompetitionInfoUp", "CompetitionInfoDown" then "竞赛名称:#{competition_info&.title}
竞赛标识:#{competition_info&.identifier}
" 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