Commit 974281d1 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

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

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent a77dfc46
......@@ -44,7 +44,11 @@ class FilteringService
when 'created-by-me', 'authored' then
current_user.send(table_name)
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
current_user.send("assigned_#{table_name}")
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment