diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-17 18:06:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-17 18:06:17 +0300 |
commit | 238d22c07218adf2b8f3db630ee8b74ca6f29df5 (patch) | |
tree | 23fd5f85efef0fb95eb73bf6395d5b7e8c0f1b9f /app/models/release.rb | |
parent | 6b75320f525f841454f1ab162d141d3610f2e77b (diff) |
Add latest changes from gitlab-org/gitlab@masterlist
Diffstat (limited to 'app/models/release.rb')
-rw-r--r-- | app/models/release.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/release.rb b/app/models/release.rb index 8759e38060c..add57367f61 100644 --- a/app/models/release.rb +++ b/app/models/release.rb @@ -14,6 +14,7 @@ class Release < ApplicationRecord has_many :milestone_releases has_many :milestones, through: :milestone_releases + has_one :evidence default_value_for :released_at, allows_nil: false do Time.zone.now @@ -28,6 +29,8 @@ class Release < ApplicationRecord delegate :repository, to: :project + after_commit :create_evidence!, on: :create + def commit strong_memoize(:commit) do repository.commit(actual_sha) @@ -66,6 +69,10 @@ class Release < ApplicationRecord repository.find_tag(tag) end end + + def create_evidence! + CreateEvidenceWorker.perform_async(self.id) + end end Release.prepend_if_ee('EE::Release') |