debian-mirror-gitlab/app/models/concerns/blob_language_from_git_attributes.rb
2019-12-16 22:33:55 +05:30

13 lines
314 B
Ruby

# frozen_string_literal: true
# Applicable for blob classes with project attribute
module BlobLanguageFromGitAttributes
extend ActiveSupport::Concern
def language_from_gitattributes
return unless project
repository = project.repository
repository.gitattribute(path, 'gitlab-language')
end
end