Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessio Caiazza <acaiazza@gitlab.com>2018-12-21 17:51:46 +0300
committerShinya Maeda <shinya@gitlab.com>2018-12-31 06:05:56 +0300
commita7aaad96f3cca5be2886bf3e18c81a7b06e5129f (patch)
tree5d9c5e548ce4a450606420e832d9e7dacdb3905e /app/finders
parentb9aac409a5dfcdd1410c37ffb6eb30264d0b2784 (diff)
ReleasesFinder will always return a relation
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/releases_finder.rb6
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