lib/switchman/test_helper.rb in switchman-1.16.0 vs lib/switchman/test_helper.rb in switchman-2.0.0

- old
+ new

@@ -1,19 +1,19 @@ module Switchman module TestHelper class << self def recreate_persistent_test_shards(dont_create: false) # recreate the default shard (it got buhleted) - ::Shackles.activate(:deploy) { Switchman.cache.clear } - if Shard.default(true).is_a?(DefaultShard) + ::GuardRail.activate(:deploy) { Switchman.cache.clear } + if Shard.default(reload: true).is_a?(DefaultShard) begin Shard.create!(default: true) rescue raise unless dont_create # database doesn't exist yet, presumably cause we're creating it right now return [nil, nil] end - Shard.default(true) + Shard.default(reload: true) end # can't auto-create a new shard on the default shard's db server if the # default shard is split across multiple db servers if ::ActiveRecord::Base.connection_handler.connection_pool_list.length > 1