Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'config/initializers/batch_loader.rb')
-rw-r--r--config/initializers/batch_loader.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/config/initializers/batch_loader.rb b/config/initializers/batch_loader.rb
index d88b43fbcea..e542a26cb81 100644
--- a/config/initializers/batch_loader.rb
+++ b/config/initializers/batch_loader.rb
@@ -1,3 +1,13 @@
# frozen_string_literal: true
Rails.application.config.middleware.use(BatchLoader::Middleware)
+
+# 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)