summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-07-20 22:12:17 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-07-20 22:12:17 +0800
commita7713232ea723a7215ab0aff4c6fed87343df1fd (patch)
tree89c865207350fb0b76fb90fc1a7ac700db5ca41e
parentfea934b596323190c966c5edf1c8631c725f3820 (diff)
downloadgitlab-ce-a7713232ea723a7215ab0aff4c6fed87343df1fd.tar.gz
Also exclude artifacts_file with empty string, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5347#note_13198105
-rw-r--r--app/models/ci/build.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 49a123d488b..f87c1206e91 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -12,7 +12,9 @@ module Ci
scope :unstarted, ->() { where(runner_id: nil) }
scope :ignore_failures, ->() { where(allow_failure: false) }
- scope :with_artifacts, ->() { where.not(artifacts_file: nil) }
+ scope :with_artifacts, ->() do
+ where.not(artifacts_file: [nil, ''])
+ end
scope :with_expired_artifacts, ->() { with_artifacts.where('artifacts_expire_at < ?', Time.now) }
scope :last_month, ->() { where('created_at > ?', Date.today - 1.month) }
scope :manual_actions, ->() { where(when: :manual) }