Welcome to mirror list, hosted at ThFree Co, Russian Federation.

snippets_helpers.rb « helpers « api « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 20aeca6a9d34f3491526b342e8a6a339e4e129ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

module API
  module Helpers
    module SnippetsHelpers
      def content_for(snippet)
        if snippet.empty_repo?
          snippet.content
        else
          blob = snippet.blobs.first
          blob.load_all_data!
          blob.data
        end
      end
    end
  end
end