diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2018-12-21 17:13:23 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-12-31 06:05:56 +0300 |
commit | b9aac409a5dfcdd1410c37ffb6eb30264d0b2784 (patch) | |
tree | b72c9ee86f5c7c20760df006bbca0500b2de48a0 /app/models/release.rb | |
parent | 1ea2d9faa518f6b769b05a71a1f93b4ea0226bc1 (diff) |
Expose assets in releases API
Diffstat (limited to 'app/models/release.rb')
-rw-r--r-- | app/models/release.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/models/release.rb b/app/models/release.rb index a4272dd63aa..06ed77f9079 100644 --- a/app/models/release.rb +++ b/app/models/release.rb @@ -17,4 +17,17 @@ class Release < ActiveRecord::Base git_tag = repository.find_tag(tag) repository.commit(git_tag.dereferenced_target) end + + def sources_formats + @sources_formats ||= %w(zip tar.gz tar.bz2 tar).freeze + end + + # TODO: placeholder for frontend API compatibility + def links + [] + end + + def assets_count + links.size + sources_formats.size + end end |