diff options
author | Regis <boudinot.regis@yahoo.com> | 2017-01-02 16:24:37 -0700 |
---|---|---|
committer | Regis <boudinot.regis@yahoo.com> | 2017-01-02 16:24:37 -0700 |
commit | 0a074f2e091d8b2f1bce49e50ecf69b667c62dc2 (patch) | |
tree | 314027556f06514278a4f83f35813c00b2d5418f /app/models/ci/pipeline.rb | |
parent | 588219352c99213d099aff72f32d6ad9ec4830d4 (diff) | |
parent | de25604fbca2f7005754d821d571bbcb1cc510ac (diff) | |
download | gitlab-ce-0a074f2e091d8b2f1bce49e50ecf69b667c62dc2.tar.gz |
fix pipelines/index.html.haml merge conflict
Diffstat (limited to 'app/models/ci/pipeline.rb')
-rw-r--r-- | app/models/ci/pipeline.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 1814469f6ce..2a97e8bae4a 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -93,11 +93,8 @@ module Ci .select("max(#{quoted_table_name}.id)") .group(:ref, :sha) - if ref - where(id: max_id, ref: ref) - else - where(id: max_id) - end + relation = ref ? where(ref: ref) : self + relation.where(id: max_id) end def self.latest_status(ref = nil) @@ -105,7 +102,7 @@ module Ci end def self.latest_successful_for(ref) - success.latest(ref).first + success.latest(ref).order(id: :desc).first end def self.truncate_sha(sha) |