diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2018-12-21 19:40:14 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-12-31 08:34:15 +0300 |
commit | 6a2decf5454922441606fce1560389acbbd9eff1 (patch) | |
tree | 1434716df04a5a8623943c85bd5b074b53320cee /app/models/release.rb | |
parent | a7aaad96f3cca5be2886bf3e18c81a7b06e5129f (diff) |
Refactor Release services
CreateReleaseService and UpdateReleaseService now takes all the release
attributes as constructor parameters. This will simplify attribute
expansion
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 27c9e35de56..7377af84e0b 100644 --- a/app/models/release.rb +++ b/app/models/release.rb @@ -15,6 +15,10 @@ class Release < ActiveRecord::Base delegate :repository, to: :project + def self.by_tag(project, tag) + self.find_by(project: project, tag: tag) + end + def commit git_tag = repository.find_tag(tag) repository.commit(git_tag.dereferenced_target) |