Open paulcsmith opened 4 years ago
There's going to have to be some way to specify to all of Avram which connection to use and not just in a particular model. If I write to the database and then later query it in the same request, I expect my changes to be there but they might not have been propagated to the read-replica yet.
Rails lays out some ways they handle it here https://guides.rubyonrails.org/active_record_multiple_databases.html
Extracted from #9
This will be super easy to implement except for the specs. Need to think of a reliable way to do test it