forked from Trustie/forgeplus
admin user action DestroyOrganization render
This commit is contained in:
parent
346b815e0a
commit
2b9e53565a
|
@ -54,6 +54,7 @@ class UserAction < ApplicationRecord
|
|||
case action_type
|
||||
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&.name}<br/>组织标识:#{organization&.login}<br/>"
|
||||
else "--"
|
||||
end
|
||||
end
|
||||
|
@ -75,6 +76,17 @@ class UserAction < ApplicationRecord
|
|||
end
|
||||
action_project
|
||||
end
|
||||
|
||||
def organization
|
||||
action_organization = if action_type == "DestroyOrganization" && data_bank.present?
|
||||
build_mode("Organization")
|
||||
else
|
||||
Organization.find_by(id: self.action_id)
|
||||
end
|
||||
action_organization
|
||||
end
|
||||
|
||||
|
||||
def build_mode(model_name)
|
||||
model = model_name.constantize.new
|
||||
model_name.constantize.column_names.each do |col|
|
||||
|
|
Loading…
Reference in New Issue