diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-13 19:24:29 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-13 19:25:18 +0400 |
commit | 68bfcd0521020d9f0154ffe767aa1e327e93ca24 (patch) | |
tree | 60b9f4c814d9583073de40785a94ff446124f6ed /app/controllers/admin | |
parent | 122acb2254c94823bd7b7b64aa1bd953df5fdf66 (diff) |
Add public filter to admin projects
Diffstat (limited to 'app/controllers/admin')
-rw-r--r-- | app/controllers/admin/projects_controller.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/controllers/admin/projects_controller.rb b/app/controllers/admin/projects_controller.rb index d5e6f3cdc0e..aa9e2f69a04 100644 --- a/app/controllers/admin/projects_controller.rb +++ b/app/controllers/admin/projects_controller.rb @@ -4,6 +4,7 @@ class Admin::ProjectsController < AdminController def index @projects = Project.scoped @projects = @projects.where(namespace_id: params[:namespace_id]) if params[:namespace_id].present? + @projects = @projects.where(public: true) if params[:public_only].present? @projects = @projects.where(namespace_id: nil) if params[:namespace_id] == Namespace.global_id @projects = @projects.search(params[:name]) if params[:name].present? @projects = @projects.includes(:namespace).order("namespaces.path, projects.name ASC").page(params[:page]).per(20) |