2021-02-03 16:09:17 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-11-03 09:16:43 -04:00
|
|
|
Rails.application.config.middleware.use(BatchLoader::Middleware)
|
2021-09-29 08:11:22 -04:00
|
|
|
|
|
|
|
# Disables replace_methods by default.
|
|
|
|
# See https://github.com/exAspArk/batch-loader#replacing-methods for more information.
|
|
|
|
module BatchLoaderWithoutMethodReplacementByDefault
|
|
|
|
def batch(replace_methods: false, **kw_args, &batch_block)
|
|
|
|
super
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
BatchLoader.prepend(BatchLoaderWithoutMethodReplacementByDefault)
|