Sha256: 11f8f732c63041fb8613f588bf0fef8fe454d4723528c1663c94917f90af6bab
Contents?: true
Size: 596 Bytes
Versions: 37
Compression:
Stored size: 596 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? cbase} _) (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
37 entries across 36 versions & 7 rubygems