R
R
Roman Mirilaczvili2021-08-21 01:02:40
Ruby on Rails
Roman Mirilaczvili, 2021-08-21 01:02:40

How to wrap bulk_import call?

There is an application on Rails 5.1. How can bulk_import/import calls be wrapped?

Tried like this, but no effect:

module ActiveRecordImportRefiner
  
  def bulk_import(*args, &block)
    puts "bulk_import"
    super(*args, &block)
  end

  def import(*args, &block)
    puts "import"
    super(*args, &block)
  end
  
end


class ApplicationRecord < ActiveRecord::Base
  include ActiveRecordImportRefiner
  self.abstract_class = true
end

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question