Class: RuboCop::Cop::Migration::BatchInBatches
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Migration::BatchInBatches
- Extended by:
- AutoCorrector
- Includes:
- Migration::CopConcerns::BatchProcessing
- Defined in:
- lib/rubocop/cop/migration/batch_in_batches.rb
Overview
Use ‘in_batches` in batch processing.
For more efficient batch processing.
Constant Summary collapse
- MSG =
'Use `in_batches` in batch processing.'- RESTRICT_ON_SEND =
%i[ delete_all update_all ].freeze
Constants included from Migration::CopConcerns::BatchProcessing
Migration::CopConcerns::BatchProcessing::BATCH_PROCESSING_METHOD_NAMES
Instance Method Summary collapse
- #on_send(node) ⇒ void (also: #on_csend)
Methods included from Migration::CopConcerns::BatchProcessing
Instance Method Details
#on_send(node) ⇒ void Also known as: on_csend
This method returns an undefined value.
57 58 59 60 61 62 63 |
# File 'lib/rubocop/cop/migration/batch_in_batches.rb', line 57 def on_send(node) return unless wrong?(node) add_offense(node) do |corrector| autocorrect(corrector, node) end end |