Created
October 31, 2017 06:47
-
-
Save daichirata/f51fc08cc2aced9600054f065040eeb5 to your computer and use it in GitHub Desktop.
turntable ext
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
# config/initializers/turntable_ext.rb | |
module TurntableExt | |
def target_shard?(shard_name) | |
(shard_name.nil? && target_shards.blank?) || Array.wrap(target_shards).include?(shard_name) | |
end | |
end | |
ActiveRecord::Migration.prepend(TurntableExt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment