Make unsynced production write blocks more robust
Make unsynced production write blocks more robust

When we create a block that allows unsynced production writes, we expect that any connection opened within that block would be allowed to write to the production database. Unfortunately, only the current `ActiveRecord::Base.connection` instance is marked as being read/write. This has caused an issue when attempting to allow rake db:test:load_structure to rake both databases as the connection we mark as read/write is not the one that ends up being used to write to the production database.

Instead of storing the state on the connection instance, we store it on `Thread.current`. This ensures that any connection we open for the duration of the block will be allowed to write to the production database.

culturecode/stagehand