diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-30 18:07:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-30 18:07:51 +0300 |
commit | 4e9acbfba3682c552b3de707c535e6257ef41054 (patch) | |
tree | 8b1fd5f89ad3f1be68d8944815b13bb7d498e4a6 /app/models/audit_event.rb | |
parent | 506d6dcd7c787ba71a8a53102f3d4fdb6adcfa5e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/audit_event.rb')
-rw-r--r-- | app/models/audit_event.rb | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/app/models/audit_event.rb b/app/models/audit_event.rb index 7ff0076c3e3..03841917bbf 100644 --- a/app/models/audit_event.rb +++ b/app/models/audit_event.rb @@ -30,26 +30,12 @@ class AuditEvent < ApplicationRecord end def author_name - lazy_author.name + self.user.name end def formatted_details details.merge(details.slice(:from, :to).transform_values(&:to_s)) end - - def lazy_author - BatchLoader.for(author_id).batch(default_value: default_author_value) do |author_ids, loader| - User.where(id: author_ids).find_each do |user| - loader.call(user.id, user) - end - end - end - - private - - def default_author_value - ::Gitlab::Audit::NullAuthor.for(author_id, details[:author_name]) - end end AuditEvent.prepend_if_ee('EE::AuditEvent') |