diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2018-12-13 14:08:53 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-12-31 06:05:56 +0300 |
commit | 1ea2d9faa518f6b769b05a71a1f93b4ea0226bc1 (patch) | |
tree | 291cd8d7a6c6113e75219dc873e24fb414df119d /app/models/release.rb | |
parent | c07bf1abf2a5c3751e575ee5926e9a052fa0b341 (diff) |
Add releases API
This commit introduces Releases API under /api/v4/projects/:id/releases
* We are introducing release policies at project level.
* We are deprecating releases changes from tags, both api and web
interface.
* Tags::CreateService no longer create a release
This feature is controlled by :releases_page feature flag
Diffstat (limited to 'app/models/release.rb')
-rw-r--r-- | app/models/release.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/release.rb b/app/models/release.rb index 7a09ee459a6..a4272dd63aa 100644 --- a/app/models/release.rb +++ b/app/models/release.rb @@ -6,7 +6,15 @@ class Release < ActiveRecord::Base cache_markdown_field :description belongs_to :project + # releases prior to 11.7 have no author belongs_to :author, class_name: 'User' validates :description, :project, :tag, presence: true + + delegate :repository, to: :project + + def commit + git_tag = repository.find_tag(tag) + repository.commit(git_tag.dereferenced_target) + end end |