diff options
Diffstat (limited to 'app/controllers/concerns/renders_notes.rb')
-rw-r--r-- | app/controllers/concerns/renders_notes.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/concerns/renders_notes.rb b/app/controllers/concerns/renders_notes.rb index cf04023080a..c5f23e33424 100644 --- a/app/controllers/concerns/renders_notes.rb +++ b/app/controllers/concerns/renders_notes.rb @@ -20,9 +20,11 @@ module RendersNotes project.team.max_member_access_for_user_ids(user_ids) end + # rubocop: disable CodeReuse/ActiveRecord def preload_noteable_for_regular_notes(notes) ActiveRecord::Associations::Preloader.new.preload(notes.reject(&:for_commit?), :noteable) end + # rubocop: enable CodeReuse/ActiveRecord def preload_first_time_contribution_for_authors(noteable, notes) return unless noteable.is_a?(Issuable) && noteable.first_contribution? @@ -30,7 +32,9 @@ module RendersNotes notes.each {|n| n.specialize_for_first_contribution!(noteable)} end + # rubocop: disable CodeReuse/ActiveRecord def preload_author_status(notes) ActiveRecord::Associations::Preloader.new.preload(notes, { author: :status }) end + # rubocop: enable CodeReuse/ActiveRecord end |