Sha256: e4b7a46bf2187945d0623d3260e740dc914ee2c6df7c4a68e04f8504c59ce9fd
Contents?: true
Size: 516 Bytes
Versions: 15
Compression:
Stored size: 516 Bytes
Contents
# frozen_string_literal: true module Gitlab module Styles module Rubocop module ModelHelpers # Returns true if the given node originated from the models directory. def in_model?(node) path = node.location.expression.source_buffer.name pwd = Dir.pwd models_path = File.join(pwd, 'app', 'models') ee_models_path = File.join(pwd, 'ee', 'app', 'models') path.start_with?(models_path, ee_models_path) end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems