3288e1a874
This style change enforces `return if ...` instead of `return nil if ...` to save maintainers a few minor review points
13 lines
314 B
Ruby
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
|