Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
ActiveRecord::Base.prohibit_shard_swapping
When using sharded databases for the lifecycle of an entire request, it's often desirable to ensure that the databases shard is not unintentionally changed. This commit introduces `ActiveRecord::Base.prohibit_shard_swapping` which takes a block and prevents swapping of shards for its duration.
- Loading branch information
1 parent
e7b050d
commit 32e2a8e
Showing
3 changed files
with
87 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters