Commit 4f2e4c76 authored by Douwe Maan's avatar Douwe Maan

Select MR commit notes from source project.

parent e739eb03
...@@ -213,10 +213,13 @@ class MergeRequest < ActiveRecord::Base ...@@ -213,10 +213,13 @@ class MergeRequest < ActiveRecord::Base
commits_for_notes_limit = 100 commits_for_notes_limit = 100
commit_ids = commits.last(commits_for_notes_limit).map(&:id) commit_ids = commits.last(commits_for_notes_limit).map(&:id)
project.notes.where( Note.where(
"(noteable_type = 'MergeRequest' AND noteable_id = :mr_id) OR (noteable_type = 'Commit' AND commit_id IN (:commit_ids))", "(project_id = :target_project_id AND noteable_type = 'MergeRequest' AND noteable_id = :mr_id) OR" +
"(project_id = :source_project_id AND noteable_type = 'Commit' AND commit_id IN (:commit_ids))",
mr_id: id, mr_id: id,
commit_ids: commit_ids commit_ids: commit_ids,
target_project_id: target_project_id,
source_project_id: source_project_id
) )
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment