diff options
Diffstat (limited to 'app/models')
| -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 |
