Sha256: 5cb7e88f0208ac30b80cfa11ca29ea2dbd84f18323ea32c367533df87066179f
Contents?: true
Size: 588 Bytes
Versions: 19
Compression:
Stored size: 588 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop # Common functionality for cops working with migrations module MigrationsHelper extend NodePattern::Macros def_node_matcher :migration_class?, <<~PATTERN (class (const nil? _) (send (const (const {nil? cbase} :ActiveRecord) :Migration) :[] (float _)) _) PATTERN def in_migration?(node) node.each_ancestor(:class).any? do |class_node| migration_class?(class_node) end end end end end
Version data entries
19 entries across 17 versions & 3 rubygems