diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-04 18:07:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-04 18:07:36 +0300 |
commit | aa542224bb345acf0cb9a1a606f0a802c16b0336 (patch) | |
tree | 496540a29aec55c6faeec7b0140824547046ae6c /app/models/release.rb | |
parent | 2494b608a460c46c759ad84bb29e6cc3447499a1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/release.rb')
-rw-r--r-- | app/models/release.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/release.rb b/app/models/release.rb index 1261402712f..ec40e8ec3e2 100644 --- a/app/models/release.rb +++ b/app/models/release.rb @@ -28,12 +28,16 @@ class Release < ApplicationRecord scope :sorted, -> { order(released_at: :desc) } scope :preloaded, -> { includes(project: :namespace) } + scope :with_project_and_namespace, -> { includes(project: :namespace) } + scope :recent, -> { sorted.limit(MAX_NUMBER_TO_DISPLAY) } delegate :repository, to: :project after_commit :create_evidence!, on: :create after_commit :notify_new_release, on: :create + MAX_NUMBER_TO_DISPLAY = 3 + def to_param CGI.escape(tag) end |