diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 00:09:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 00:09:32 +0300 |
commit | ae0889b3960606a480d2d09a57bdab59ddba6195 (patch) | |
tree | 7b2a20fa9bb427b19a0f6377df4bd6c048256ecf /app/models/release.rb | |
parent | 7ea5ca0bb5aa9792c514a22d59217dffa3800581 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/release.rb')
-rw-r--r-- | app/models/release.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/release.rb b/app/models/release.rb index c56df0a6aa3..bebf91fb247 100644 --- a/app/models/release.rb +++ b/app/models/release.rb @@ -29,6 +29,8 @@ class Release < ApplicationRecord scope :preloaded, -> { includes(:evidences, :milestones, project: [:project_feature, :route, { namespace: :route }]) } scope :with_project_and_namespace, -> { includes(project: :namespace) } scope :recent, -> { sorted.limit(MAX_NUMBER_TO_DISPLAY) } + scope :without_evidence, -> { left_joins(:evidences).where(::Releases::Evidence.arel_table[:id].eq(nil)) } + scope :released_within_2hrs, -> { where(released_at: Time.zone.now - 1.hour..Time.zone.now + 1.hour) } # Sorting scope :order_created, -> { reorder('created_at ASC') } |