Module: Gitlab::Styles::Rubocop::MigrationHelpers
- Included in:
- Rubocop::Cop::Migration::UpdateLargeTable
- Defined in:
- lib/gitlab/styles/rubocop/migration_helpers.rb
Overview
Module containing helper methods for writing migration cops.
Instance Method Summary collapse
-
#in_migration?(node) ⇒ Boolean
Returns true if the given node originated from the db/migrate directory.
Instance Method Details
#in_migration?(node) ⇒ Boolean
Returns true if the given node originated from the db/migrate directory.
9 10 11 12 13 14 15 16 17 |
# File 'lib/gitlab/styles/rubocop/migration_helpers.rb', line 9 def in_migration?(node) dirname = File.dirname(node.source_range.source_buffer.name) dirname.end_with?( 'db/migrate', 'db/post_migrate', 'ee/db/migrate', 'ee/db/post_migrate') end |