diff options
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index fe08e95ce..25b0e1da8 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -442,6 +442,18 @@ class Repository < ActiveRecord::Base end end + # Returns a scope of changesets that come from the same commit as the given changeset + # in different repositories that point to the same backend + def same_commits_in_scope(scope, changeset) + scope = scope.joins(:repository).where(:repositories => {:url => url, :root_url => root_url, :type => type}) + if changeset.scmid.present? + scope = scope.where(:scmid => changeset.scmid) + else + scope = scope.where(:revision => changeset.revision) + end + scope + end + protected def check_default |