summaryrefslogtreecommitdiff
path: root/app/models/release.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-17 18:08:05 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-17 18:08:05 +0000
commit184c2ced0761bd8dd7032619d16d3983fed7944a (patch)
treecc82b32ee7c1797509da3cf384617e4ffa2e1733 /app/models/release.rb
parent238d22c07218adf2b8f3db630ee8b74ca6f29df5 (diff)
downloadgitlab-ce-184c2ced0761bd8dd7032619d16d3983fed7944a.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/release.rb')
-rw-r--r--app/models/release.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/release.rb b/app/models/release.rb
index add57367f61..5a7bfe2d495 100644
--- a/app/models/release.rb
+++ b/app/models/release.rb
@@ -26,10 +26,12 @@ class Release < ApplicationRecord
validates_associated :milestone_releases, message: -> (_, obj) { obj[:value].map(&:errors).map(&:full_messages).join(",") }
scope :sorted, -> { order(released_at: :desc) }
+ scope :with_project_and_namespace, -> { includes(project: :namespace) }
delegate :repository, to: :project
after_commit :create_evidence!, on: :create
+ after_commit :notify_new_release, on: :create
def commit
strong_memoize(:commit) do
@@ -73,6 +75,10 @@ class Release < ApplicationRecord
def create_evidence!
CreateEvidenceWorker.perform_async(self.id)
end
+
+ def notify_new_release
+ NewReleaseWorker.perform_async(id)
+ end
end
Release.prepend_if_ee('EE::Release')