Sha256: c6f8098a1bd275a4f20b7817b5a758eb612adb61a4055b3e477c1b701447455a

Contents?: true

Size: 1.14 KB

Versions: 16

Compression:

Stored size: 1.14 KB

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    # A mixin to extend cops for Active Record features
    module ActiveRecordMigrationsHelper
      extend NodePattern::Macros

      RAILS_ABSTRACT_SCHEMA_DEFINITIONS = %i[
        bigint binary boolean date datetime decimal float integer json string
        text time timestamp virtual
      ].freeze
      RAILS_ABSTRACT_SCHEMA_DEFINITIONS_HELPERS = %i[
        column references belongs_to primary_key numeric
      ].freeze
      POSTGRES_SCHEMA_DEFINITIONS = %i[
        bigserial bit bit_varying cidr citext daterange hstore inet interval
        int4range int8range jsonb ltree macaddr money numrange oid point line
        lseg box path polygon circle serial tsrange tstzrange tsvector uuid xml
      ].freeze
      MYSQL_SCHEMA_DEFINITIONS = %i[
        blob tinyblob mediumblob longblob tinytext mediumtext longtext
        unsigned_integer unsigned_bigint unsigned_float unsigned_decimal
      ].freeze

      def_node_matcher :create_table_with_block?, <<~PATTERN
        (block
          (send nil? :create_table ...)
          (args (arg _var))
          _)
      PATTERN
    end
  end
end

Version data entries

16 entries across 14 versions & 3 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/rubocop-rails-2.15.2/lib/rubocop/cop/mixin/active_record_migrations_helper.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/rubocop-rails-2.15.2/lib/rubocop/cop/mixin/active_record_migrations_helper.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/rubocop-rails-2.15.2/lib/rubocop/cop/mixin/active_record_migrations_helper.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-rails-2.14.2/lib/rubocop/cop/mixin/active_record_migrations_helper.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-rails-2.15.2/lib/rubocop/cop/mixin/active_record_migrations_helper.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-rails-2.14.2/lib/rubocop/cop/mixin/active_record_migrations_helper.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-rails-2.15.2/lib/rubocop/cop/mixin/active_record_migrations_helper.rb
rubocop-rails-2.15.2 lib/rubocop/cop/mixin/active_record_migrations_helper.rb
rubocop-rails-2.15.1 lib/rubocop/cop/mixin/active_record_migrations_helper.rb
rubocop-rails-2.15.0 lib/rubocop/cop/mixin/active_record_migrations_helper.rb
rubocop-rails-2.14.2 lib/rubocop/cop/mixin/active_record_migrations_helper.rb
rubocop-rails-2.14.1 lib/rubocop/cop/mixin/active_record_migrations_helper.rb
rubocop-rails-2.14.0 lib/rubocop/cop/mixin/active_record_migrations_helper.rb
rubocop-rails-2.13.2 lib/rubocop/cop/mixin/active_record_migrations_helper.rb
rubocop-rails-2.13.1 lib/rubocop/cop/mixin/active_record_migrations_helper.rb
rubocop-rails-2.13.0 lib/rubocop/cop/mixin/active_record_migrations_helper.rb