debian-mirror-gitlab/config/initializers/batch_loader.rb

14 lines
423 B
Ruby
Raw Normal View History

2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
2018-03-17 18:26:18 +05:30
Rails.application.config.middleware.use(BatchLoader::Middleware)
2021-11-18 22:05:49 +05:30
# 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)