Sha256: e96fb51af75f1ec4a737a3f59fbb535cda3e07426e9d1b94eac1981d42af3820
Contents?: true
Size: 485 Bytes
Versions: 6
Compression:
Stored size: 485 Bytes
Contents
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
6 entries across 6 versions & 1 rubygems