Class: RuboCop::Cop::Sequel::ConcurrentIndex

Inherits:
Base
  • Object
show all
Includes:
Helpers::Migration
Defined in:
lib/rubocop/cop/sequel/concurrent_index.rb

Overview

ConcurrentIndex looks for non-concurrent index creation.

Constant Summary collapse

MSG =
'Specify `concurrently` option when creating or dropping an index.'
RESTRICT_ON_SEND =
%i[add_index drop_index].freeze

Instance Method Summary collapse

Methods included from Helpers::Migration

#within_sequel_migration?

Instance Method Details

#on_send(node) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/rubocop/cop/sequel/concurrent_index.rb', line 17

def on_send(node)
  return unless within_sequel_migration?(node)

  indexes?(node) do |args|
    add_offense(node.loc.selector, message: MSG) if offensive?(args)
  end
end