blob: 72bf968c8ec122beda224c4e944f2528184da647 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
# frozen_string_literal: true
class ReleasesFinder
def initialize(project, current_user = nil)
@project = project
@current_user = current_user
end
def execute(preload: true)
return Release.none unless Ability.allowed?(@current_user, :read_release, @project)
releases = @project.releases
releases = releases.preloaded if preload
releases.sorted
end
end
|