Also exclude artifacts_file with empty string, feedback:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5347#note_13198105
This commit is contained in:
Lin Jen-Shin 2016-07-20 22:12:17 +08:00
parent fea934b596
commit a7713232ea

View file

@ -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) }