diff options
Diffstat (limited to 'app/finders/projects_finder.rb')
-rw-r--r-- | app/finders/projects_finder.rb | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/app/finders/projects_finder.rb b/app/finders/projects_finder.rb index 126687ae41f..1afd5adeada 100644 --- a/app/finders/projects_finder.rb +++ b/app/finders/projects_finder.rb @@ -89,6 +89,7 @@ class ProjectsFinder < UnionFinder collection = by_not_aimed_for_deletion(collection) collection = by_last_activity_after(collection) collection = by_last_activity_before(collection) + collection = by_language(collection) by_repository_storage(collection) end @@ -97,12 +98,10 @@ class ProjectsFinder < UnionFinder current_user.owned_projects elsif min_access_level? current_user.authorized_projects(params[:min_access_level]) + elsif private_only? || impossible_visibility_level? + current_user.authorized_projects else - if private_only? || impossible_visibility_level? - current_user.authorized_projects - else - Project.public_or_visible_to_user(current_user) - end + Project.public_or_visible_to_user(current_user) end end @@ -239,6 +238,14 @@ class ProjectsFinder < UnionFinder end end + def by_language(items) + if Feature.enabled?(:project_language_search, current_user) && params[:language].present? + items.with_programming_language_id(params[:language]) + else + items + end + end + def sort(items) if params[:sort].present? items.sort_by_attribute(params[:sort]) |