diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-01 06:06:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-01 06:06:26 +0300 |
commit | 56d96ad7fab4d4b95f5529d8080b3cc2873794a0 (patch) | |
tree | 7fe93fc8ff4d82d815000781ffb9c98d7259211a /app/finders/releases_finder.rb | |
parent | 8078bd185fd9fce86cb5a8d9a6b6209e0c23ae44 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/finders/releases_finder.rb')
-rw-r--r-- | app/finders/releases_finder.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/finders/releases_finder.rb b/app/finders/releases_finder.rb index 59e84198fde..72bf968c8ec 100644 --- a/app/finders/releases_finder.rb +++ b/app/finders/releases_finder.rb @@ -6,9 +6,11 @@ class ReleasesFinder @current_user = current_user end - def execute + def execute(preload: true) return Release.none unless Ability.allowed?(@current_user, :read_release, @project) - @project.releases.sorted + releases = @project.releases + releases = releases.preloaded if preload + releases.sorted end end |