diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2018-12-21 15:51:46 +0100 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-12-31 12:05:56 +0900 |
commit | a7aaad96f3cca5be2886bf3e18c81a7b06e5129f (patch) | |
tree | 5d9c5e548ce4a450606420e832d9e7dacdb3905e /app/finders | |
parent | b9aac409a5dfcdd1410c37ffb6eb30264d0b2784 (diff) | |
download | gitlab-ce-a7aaad96f3cca5be2886bf3e18c81a7b06e5129f.tar.gz |
ReleasesFinder will always return a relation
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/releases_finder.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/app/finders/releases_finder.rb b/app/finders/releases_finder.rb index c185f77afa2..59e84198fde 100644 --- a/app/finders/releases_finder.rb +++ b/app/finders/releases_finder.rb @@ -6,11 +6,9 @@ class ReleasesFinder @current_user = current_user end - # rubocop: disable CodeReuse/ActiveRecord def execute - return [] unless Ability.allowed?(@current_user, :read_release, @project) + return Release.none unless Ability.allowed?(@current_user, :read_release, @project) - @project.releases.order('created_at DESC') + @project.releases.sorted end - # rubocop: enable CodeReuse/ActiveRecord end |