summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/issuable_finder.rb10
-rw-r--r--app/finders/joined_groups_finder.rb5
2 files changed, 4 insertions, 11 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb
index dd4208880b6..046286dd9e1 100644
--- a/app/finders/issuable_finder.rb
+++ b/app/finders/issuable_finder.rb
@@ -171,15 +171,13 @@ class IssuableFinder
end
def by_scope(items)
- case params[:scope] || 'all'
- when 'created-by-me', 'authored' then
+ case params[:scope]
+ when 'created-by-me', 'authored'
items.where(author_id: current_user.id)
- when 'all' then
- items
- when 'assigned-to-me' then
+ when 'assigned-to-me'
items.where(assignee_id: current_user.id)
else
- raise 'You must specify default scope'
+ items
end
end
diff --git a/app/finders/joined_groups_finder.rb b/app/finders/joined_groups_finder.rb
index 2a3f0296d37..47174980258 100644
--- a/app/finders/joined_groups_finder.rb
+++ b/app/finders/joined_groups_finder.rb
@@ -5,11 +5,6 @@ class JoinedGroupsFinder < UnionFinder
# Finds the groups of the source user, optionally limited to those visible to
# the current user.
- #
- # current_user - If given the groups of "@user" will only include the groups
- # "current_user" can also see.
- #
- # Returns an ActiveRecord::Relation.
def execute(current_user = nil)
segments = all_groups(current_user)