Add `ActiveRecord::Base.prohibit_shard_swapping` by seejohnrun · Pull Request #4...
source link: https://github.com/rails/rails/pull/43485
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Summary
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.
cc / @eileencodes
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK