debian-mirror-gitlab/rubocop/migration_helpers.rb

11 lines
328 B
Ruby
Raw Normal View History

2016-08-24 12:49:21 +05:30
module RuboCop
# Module containing helper methods for writing migration cops.
module MigrationHelpers
# Returns true if the given node originated from the db/migrate directory.
def in_migration?(node)
File.dirname(node.location.expression.source_buffer.name).
end_with?('db/migrate')
end
end
end