debian-mirror-gitlab/lib/api/helpers/snippets_helpers.rb

18 lines
314 B
Ruby
Raw Normal View History

2020-05-24 23:13:21 +05:30
# 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