Fix incorrect connection pool for batchable model in Rails 7.2

What does this MR do and why?

In Rails 7.2, ActiveRecord uses the model's connection_pool method to fetch a connection for the schema cache.

Our batchable model helper creates a model class with a custom connection so we must also override the connection_pool method to use the same connection.

See https://github.com/rails/rails/commit/1af13c645a16bf2c73d2e516c911aa6c61a2fd05

References

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Heinrich Lee Yu

Merge request reports

Loading