Skip to content
Snippets Groups Projects
Verified Commit 974281d1 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

FilteringService works with scope :all event if current user is not defined

parent a77dfc46
No related branches found
No related tags found
No related merge requests found
Loading
@@ -44,7 +44,11 @@ class FilteringService
Loading
@@ -44,7 +44,11 @@ class FilteringService
when 'created-by-me', 'authored' then when 'created-by-me', 'authored' then
current_user.send(table_name) current_user.send(table_name)
when 'all' then when 'all' then
klass.of_projects(current_user.authorized_projects.pluck(:id)) if current_user
klass.of_projects(current_user.authorized_projects.pluck(:id))
else
klass.of_projects(Project.public_only)
end
when 'assigned-to-me' then when 'assigned-to-me' then
current_user.send("assigned_#{table_name}") current_user.send("assigned_#{table_name}")
else else
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment