diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-07-16 18:18:52 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-07-30 15:01:26 +0200 |
commit | f1d3ea63cf74d2791a9a863b29ab2d919ea61bd0 (patch) | |
tree | c36c2b272fba917af321a4f16c34a5047407f3b2 /app/controllers/concerns/renders_notes.rb | |
parent | b4c4b48a8c0258ff266c523488aa169a1b5ea0f3 (diff) | |
download | gitlab-ce-f1d3ea63cf74d2791a9a863b29ab2d919ea61bd0.tar.gz |
Show the status of a user in interactions
The status is shown for
- The author of a commit when viewing a commit
- Notes on a commit (regular/diff)
- The user that triggered a pipeline when viewing a pipeline
- The author of a merge request when viewing a merge request
- The author of notes on a merge request (regular/diff)
- The author of an issue when viewing an issue
- The author of notes on an issue
- The author of a snippet when viewing a snippet
- The author of notes on a snippet
- A user's profile page
- The list of members of a group/user
Diffstat (limited to 'app/controllers/concerns/renders_notes.rb')
-rw-r--r-- | app/controllers/concerns/renders_notes.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/concerns/renders_notes.rb b/app/controllers/concerns/renders_notes.rb index 36e3d76ecfe..cf04023080a 100644 --- a/app/controllers/concerns/renders_notes.rb +++ b/app/controllers/concerns/renders_notes.rb @@ -4,6 +4,7 @@ module RendersNotes preload_noteable_for_regular_notes(notes) preload_max_access_for_authors(notes, @project) preload_first_time_contribution_for_authors(noteable, notes) + preload_author_status(notes) Notes::RenderService.new(current_user).execute(notes) notes @@ -28,4 +29,8 @@ module RendersNotes notes.each {|n| n.specialize_for_first_contribution!(noteable)} end + + def preload_author_status(notes) + ActiveRecord::Associations::Preloader.new.preload(notes, { author: :status }) + end end |