diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-07-28 07:09:40 +0200 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-07-29 14:08:41 +0200 |
commit | d05af7b7c6975ae66808ed6676a1b947c7abe244 (patch) | |
tree | b158cf69a40b7806691f877292eb5c94b6f2cae9 /app/models | |
parent | 41057b856eaf309ba6a80c03fa284dd07e2c73a3 (diff) | |
download | gitlab-ce-d05af7b7c6975ae66808ed6676a1b947c7abe244.tar.gz |
Check for Ci::Build artifacts at database level
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/ci/build.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index aac78d75f57..08f396210c9 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -13,6 +13,7 @@ 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_not_expired, ->() { with_artifacts.where('artifacts_expire_at IS NULL OR artifacts_expire_at > ?', Time.now) } 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) } |