Skip to content

Commit

Permalink
Merge pull request #6682 from coolo/avoid_sql3
Browse files Browse the repository at this point in the history
Avoid N+1 queries in update policy
  • Loading branch information
coolo committed Dec 20, 2018
2 parents 708540b + 5f77a02 commit f47ecab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/app/models/project.rb
Expand Up @@ -1586,7 +1586,7 @@ def self.remove_repositories(repositories, opts = {})
end

def has_remote_repositories?
repositories.any? { |r| r.download_repositories.any? }
DownloadRepository.where(repository_id: repositories.select(:id)).exists?
end

def api_obj
Expand Down

0 comments on commit f47ecab

Please sign in to comment.