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

Signed-off-by: NDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册