summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-08-24 21:29:51 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2015-08-24 21:29:51 +0100
commit349764beee84d45da26703fd07f325815beb8c7f (patch)
tree8a911ada4a96e93199f331c94dd41bc55c3d320e /app
parentb0dc7c0bd80994a4d4b9397e1b3028cde4de8784 (diff)
downloadgitlab-ci-349764beee84d45da26703fd07f325815beb8c7f.tar.gz
Order commits by committed_at and id
This needs to be done that way, because the committed_at can be null for some pretty old commits.
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 4879f24..f0cf3a5 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) }, dependent: :destroy
+ has_many :commits, ->() { order(:committed_at, :id) }, dependent: :destroy
has_many :builds, through: :commits, dependent: :destroy
has_many :runner_projects, dependent: :destroy
has_many :runners, through: :runner_projects