gocardless / statesman

A statesmanlike state machine library.
https://gocardless.com/blog/statesman/
MIT License
1.78k stars 163 forks source link

Add multi-database support to Statesman. #522

Closed benk-gc closed 12 months ago

benk-gc commented 1 year ago

Statesman currently relies heavily on ActiveRecord::Base, either explicitly or implicitly, when querying database connections. This doesn't play well when we have models or transitions which live on a different database, since it forces us to open a query to the primary connection pool.

This is a series of changes to allow Statesman to use the context it has available for the model or transition class, and make use of the appropriate connection.