Make MRs also count and display its commits' notes
This commit is contained in:
parent
77bde9a0e4
commit
6dc8c0eac2
3 changed files with 21 additions and 1 deletions
|
@ -186,6 +186,11 @@ class MergeRequest < ActiveRecord::Base
|
|||
|
||||
patch_path
|
||||
end
|
||||
|
||||
def mr_and_commit_notes
|
||||
commit_ids = commits.map(&:id)
|
||||
Note.where("(noteable_type = 'MergeRequest' AND noteable_id = :mr_id) OR (noteable_type = 'Commit' AND noteable_id IN (:commit_ids))", mr_id: id, commit_ids: commit_ids)
|
||||
end
|
||||
end
|
||||
|
||||
# == Schema Information
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue