diff options
Diffstat (limited to 'app/finders/projects/topics_finder.rb')
-rw-r--r-- | app/finders/projects/topics_finder.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/finders/projects/topics_finder.rb b/app/finders/projects/topics_finder.rb index c26b166a786..fb0a77db548 100644 --- a/app/finders/projects/topics_finder.rb +++ b/app/finders/projects/topics_finder.rb @@ -13,6 +13,7 @@ module Projects def execute topics = Projects::Topic.order_by_non_private_projects_count + topics = by_without_projects(topics) by_search(topics) end @@ -25,5 +26,11 @@ module Projects topics.search(params[:search]).reorder_by_similarity(params[:search]) end + + def by_without_projects(topics) + return topics unless params[:without_projects] + + topics.without_assigned_projects + end end end |