From cf36e89f5605b0344c2a306b5923bac96ced1c78 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Fri, 27 Sep 2024 10:02:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E8=AE=B0=E5=BD=95=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E6=9F=A5=E8=AF=A2=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/user_action.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/models/user_action.rb b/app/models/user_action.rb index 7405c0c44..cf797cfce 100644 --- a/app/models/user_action.rb +++ b/app/models/user_action.rb @@ -48,10 +48,11 @@ class UserAction < ApplicationRecord end def user - action_user = User.find_by(id: self.user_id) - if action_user.blank? - action_user = self.action_data - end + action_user = if action_type == "DestroyUser" && data_bank.present? + build_mode("User") + else + User.find_by(id: self.user_id) + end action_user end def build_mode(model_name)