diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-15 15:09:18 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-15 15:09:18 +0300 |
commit | b7c735c8ac11b8182807070fc6f84f2606e15427 (patch) | |
tree | e74b4d25abb8bbf23546f001dd94515e2840a3a3 /app/helpers | |
parent | 221b529789f4090341a825695aeb49b8df6dd11d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/snippets_helper.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/helpers/snippets_helper.rb b/app/helpers/snippets_helper.rb index fd7e58826b5..a9f90a8f5e4 100644 --- a/app/helpers/snippets_helper.rb +++ b/app/helpers/snippets_helper.rb @@ -160,4 +160,14 @@ module SnippetsHelper title: 'Download', rel: 'noopener noreferrer') end + + def snippet_file_name(snippet) + blob = if Feature.enabled?(:version_snippets, current_user) && !snippet.repository.empty? + snippet.blobs.first + else + snippet.blob + end + + blob.name + end end |