summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-08-26 17:14:22 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2015-08-26 17:14:22 +0100
commitf8eca1724901cd5b8949c6bdff362405ff7ed754 (patch)
tree7889fd3ee6879efac5386158ea874e03f69c3a31 /app
parente99cdfd1d55d274e22c35a548da3bb5a2ba1e241 (diff)
downloadgitlab-ci-f8eca1724901cd5b8949c6bdff362405ff7ed754.tar.gz
Fix commits ordering when using PostgreSQLfix-commits-ordering-for-postgresql
Diffstat (limited to 'app')
-rw-r--r--app/models/project.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index f0cf3a5..9b8815e 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -28,7 +28,7 @@
class Project < ActiveRecord::Base
include ProjectStatus
- has_many :commits, ->() { order(:committed_at, :id) }, dependent: :destroy
+ has_many :commits, ->() { order('CASE WHEN commits.committed_at IS NULL THEN 0 ELSE 1 END', :committed_at, :id) }, dependent: :destroy
has_many :builds, through: :commits, dependent: :destroy
has_many :runner_projects, dependent: :destroy
has_many :runners, through: :runner_projects