diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-09-15 13:50:24 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-09-15 13:50:24 +0300 |
commit | 22bf844869bde4e480d981b2f267bc692e701eb4 (patch) | |
tree | 09e0ff53115309652e61df7ef712a37daf41bee4 /lib/api/projects.rb | |
parent | 9a3d0f1d92ee99792b40c401f83121adb8fd3387 (diff) | |
download | gitlab-ce-22bf844869bde4e480d981b2f267bc692e701eb4.tar.gz |
fix specs. Stage 3
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r-- | lib/api/projects.rb | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 1f2251c9b9c..c2fb36b4143 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -11,42 +11,6 @@ module API attrs[:visibility_level] = Gitlab::VisibilityLevel::PUBLIC if !attrs[:visibility_level].present? && publik == true attrs end - - def filter_projects(projects) - # If the archived parameter is passed, limit results accordingly - if params[:archived].present? - projects = projects.where(archived: parse_boolean(params[:archived])) - end - - if params[:search].present? - projects = projects.search(params[:search]) - end - - if params[:ci_enabled_first].present? - projects.includes(:gitlab_ci_service). - reorder("services.active DESC, projects.#{project_order_by} #{project_sort}") - else - projects.reorder(project_order_by => project_sort) - end - end - - def project_order_by - order_fields = %w(id name path created_at updated_at last_activity_at) - - if order_fields.include?(params['order_by']) - params['order_by'] - else - 'created_at' - end - end - - def project_sort - if params["sort"] == 'asc' - :asc - else - :desc - end - end end # Get a projects list for authenticated user |