diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-09-24 07:32:29 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-09-24 07:32:29 +0000 |
commit | a58c6e9a9561ffbb3d16a3a9a45bd90a34735b50 (patch) | |
tree | 337d55fce3c4a66ced6215d05cab3cb09f15c48e /lib | |
parent | 68cb24c4393b2c4e40700ba05039ed1412adcd64 (diff) | |
parent | 4bc1e040d4b7d73bd7afb3dbb95c87983eef2b04 (diff) | |
download | gitlab-ce-a58c6e9a9561ffbb3d16a3a9a45bd90a34735b50.tar.gz |
Merge branch 'cleanup-ci-dashboard' into 'master'
Cleanup ci dashboard
Part of #2594. Based on !1403
* remove rendering GitLab projects with not enabled CI on CI dashboard
* remove enabling CI for projects from CI dashboard (now its done by simply pushing `.gitlab-ci.yml`)
* simplify the projects query for CI dashboard
See merge request !1405
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ci/project_list_builder.rb | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/lib/ci/project_list_builder.rb b/lib/ci/project_list_builder.rb deleted file mode 100644 index da26f9a9f47..00000000000 --- a/lib/ci/project_list_builder.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Ci - class ProjectListBuilder - def execute(current_user, search = nil) - projects = current_user.authorized_projects - projects = projects.search(search) if search - - projects. - joins("LEFT JOIN ci_projects ON projects.id = ci_projects.gitlab_id - LEFT JOIN #{last_commit_subquery} AS last_commit ON #{Ci::Project.table_name}.id = last_commit.project_id"). - reorder("ci_projects.id is NULL ASC, - CASE WHEN last_commit.committed_at IS NULL THEN 1 ELSE 0 END, - last_commit.committed_at DESC") - end - - private - - def last_commit_subquery - "(SELECT project_id, MAX(committed_at) committed_at FROM #{Ci::Commit.table_name} GROUP BY project_id)" - end - end -end |