Custom database resolver

https://api.rubyonrails.org/classes/ActiveRecord/Middleware/DatabaseSelector.html

What is the contract for a custom database_resolver ? Looks like a resolver_klass class must support a read and write method - https://github.com/rails/rails/blob/75ac626c4e21129d8296d4206a1960563cc3d4aa/activerecord/lib/active_record/middleware/database_selector.rb#L60-L68

See also https://github.com/rails/rails/blob/75ac626c4e21129d8296d4206a1960563cc3d4aa/activerecord/lib/active_record/middleware/database_selector/resolver.rb for the implementation of the default resolver class

Edited May 10, 2021 by Thong Kuah
Assignee Loading
Time tracking Loading