diff options
Diffstat (limited to 'app/presenters/snippet_presenter.rb')
-rw-r--r-- | app/presenters/snippet_presenter.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/presenters/snippet_presenter.rb b/app/presenters/snippet_presenter.rb index ba0b2b42383..faaf7568c72 100644 --- a/app/presenters/snippet_presenter.rb +++ b/app/presenters/snippet_presenter.rb @@ -12,11 +12,11 @@ class SnippetPresenter < Gitlab::View::Presenter::Delegated end def ssh_url_to_repo - snippet.ssh_url_to_repo if snippet.versioned_enabled_for?(current_user) + snippet.ssh_url_to_repo if snippet.repository_exists? end def http_url_to_repo - snippet.http_url_to_repo if snippet.versioned_enabled_for?(current_user) + snippet.http_url_to_repo if snippet.repository_exists? end def can_read_snippet? @@ -36,10 +36,10 @@ class SnippetPresenter < Gitlab::View::Presenter::Delegated end def blob - if Feature.enabled?(:version_snippets, current_user) && !snippet.repository.empty? - snippet.blobs.first - else + if snippet.empty_repo? snippet.blob + else + snippet.blobs.first end end |