Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-09-16 17:59:54 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2015-09-16 17:59:54 +0300
commit912f470497129b0d8759b18700299e38535e7bec (patch)
tree47d58838d15fb6de49f2e3a335df43db9e5b0348 /app/models
parent1b2a1d0ddd39ecc530c64563d0083e1e255f7c1a (diff)
Fix ordering issue
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/project.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/ci/project.rb b/app/models/ci/project.rb
index 2cf1783616f..cd2692246b7 100644
--- a/app/models/ci/project.rb
+++ b/app/models/ci/project.rb
@@ -33,7 +33,7 @@ module Ci
belongs_to :gl_project, class_name: '::Project', foreign_key: :gitlab_id
- has_many :commits, ->() { order(:committed_at) }, dependent: :destroy, class_name: 'Ci::Commit'
+ has_many :commits, ->() { order('CASE WHEN commits.committed_at IS NULL THEN 0 ELSE 1 END', :committed_at, :id) }, dependent: :destroy, class_name: 'Ci::Commit'
has_many :builds, through: :commits, dependent: :destroy, class_name: 'Ci::Build'
has_many :runner_projects, dependent: :destroy, class_name: 'Ci::RunnerProject'
has_many :runners, through: :runner_projects, class_name: 'Ci::Runner'