summaryrefslogtreecommitdiff
path: root/app/controllers/concerns/renders_notes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/concerns/renders_notes.rb')
-rw-r--r--app/controllers/concerns/renders_notes.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/app/controllers/concerns/renders_notes.rb b/app/controllers/concerns/renders_notes.rb
index b6cf366c05c..4791bc561a4 100644
--- a/app/controllers/concerns/renders_notes.rb
+++ b/app/controllers/concerns/renders_notes.rb
@@ -2,7 +2,7 @@ module RendersNotes
def prepare_notes_for_rendering(notes, noteable = nil)
preload_noteable_for_regular_notes(notes)
preload_max_access_for_authors(notes, @project)
- preload_first_time_contribution_for_authors(noteable, notes) if noteable.is_a?(Issuable)
+ preload_first_time_contribution_for_authors(noteable, notes)
Banzai::NoteRenderer.render(notes, @project, current_user)
notes
@@ -21,12 +21,9 @@ module RendersNotes
ActiveRecord::Associations::Preloader.new.preload(notes.reject(&:for_commit?), :noteable)
end
- def preload_first_time_contribution_for_authors(issuable, notes)
- return unless issuable.first_contribution?
+ def preload_first_time_contribution_for_authors(noteable, notes)
+ return unless noteable.is_a?(Issuable) && noteable.first_contribution?
- same_author = lambda {|n| n.author_id == issuable.author_id}
- notes.each do |note|
- note.specialize!(Note::SpecialRole::FIRST_TIME_CONTRIBUTOR, &same_author)
- end
+ notes.each {|n| n.specialize_for_first_contribution!(noteable)}
end
end