Sha256: 4ee6a43f7e18f3404264756dcfd7e3754b735fef530a72ad2a231a4e149527d2

Contents?: true

Size: 531 Bytes

Versions: 13

Compression:

Stored size: 531 Bytes

Contents

module Gitlab
  module Styles
    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)
          dirname = File.dirname(node.location.expression.source_buffer.name)

          dirname.end_with?(
            'db/migrate',
            'db/post_migrate',
            'ee/db/migrate',
            'ee/db/post_migrate')
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
gitlab-styles-3.3.0 lib/gitlab/styles/rubocop/migration_helpers.rb
gitlab-styles-3.2.0 lib/gitlab/styles/rubocop/migration_helpers.rb
gitlab-styles-3.1.0 lib/gitlab/styles/rubocop/migration_helpers.rb
gitlab-styles-3.0.0 lib/gitlab/styles/rubocop/migration_helpers.rb
gitlab-styles-2.8.0 lib/gitlab/styles/rubocop/migration_helpers.rb
gitlab-styles-2.7.0 lib/gitlab/styles/rubocop/migration_helpers.rb
gitlab-styles-2.6.2 lib/gitlab/styles/rubocop/migration_helpers.rb
gitlab-styles-2.6.1 lib/gitlab/styles/rubocop/migration_helpers.rb
gitlab-styles-2.6.0 lib/gitlab/styles/rubocop/migration_helpers.rb
gitlab-styles-2.5.2 lib/gitlab/styles/rubocop/migration_helpers.rb
gitlab-styles-2.5.1 lib/gitlab/styles/rubocop/migration_helpers.rb
gitlab-styles-2.5.0 lib/gitlab/styles/rubocop/migration_helpers.rb
gitlab-styles-2.4.1 lib/gitlab/styles/rubocop/migration_helpers.rb