diff options
Diffstat (limited to 'app/presenters/releases')
-rw-r--r-- | app/presenters/releases/link_presenter.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/presenters/releases/link_presenter.rb b/app/presenters/releases/link_presenter.rb new file mode 100644 index 00000000000..cc89762a922 --- /dev/null +++ b/app/presenters/releases/link_presenter.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Releases + class LinkPresenter < Gitlab::View::Presenter::Delegated + def direct_asset_url + return @subject.url unless @subject.filepath + + release = @subject.release.present + release.download_url(@subject.filepath) + end + end +end |