diff options
| author | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-10-05 00:25:40 +0200 |
|---|---|---|
| committer | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-10-10 01:31:36 +0200 |
| commit | 6dc8c0eac28d826a4a58bcb3cdac070f3de2a10c (patch) | |
| tree | d65d7d0e9978f4571d54f0454b9ca1fe822176c8 /app/models/merge_request.rb | |
| parent | 77bde9a0e41e9229357983d258eaea9d7ef67017 (diff) | |
| download | gitlab-ce-6dc8c0eac28d826a4a58bcb3cdac070f3de2a10c.tar.gz | |
Make MRs also count and display its commits' notes
Diffstat (limited to 'app/models/merge_request.rb')
| -rw-r--r-- | app/models/merge_request.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index b6392ce8f5d..5b3c37249fc 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -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 |
