def with_shard(shard)
      shard = cluster.to_shard(shard)

      old_shard = current_shard
      old_fixed = fixed_shard
      self.current_shard = shard
      self.fixed_shard = shard
      yield
    ensure
      self.fixed_shard = old_fixed
      self.current_shard = old_shard
    end
def with_shard(shard)
      shard = cluster.to_shard(shard)

      old_shard = current_shard
      old_fixed = fixed_shard
      self.current_shard = shard
      self.fixed_shard = shard
      yield
    ensure
      self.fixed_shard = old_fixed
      self.current_shard = old_shard
    end
Fix connection to given shard in block
 @param [ActiveRecord::Base, Symbol, ActiveRecord::Turntable::Shard, Numeric, String] shard which you want to fix
 @param shard [ActiveRecord::Base] AR Object
 @param shard [Symbol] shard name symbol that defined in turntable.yml
 @param shard [ActiveRecord::Turntable::Shard] Shard object
 @param shard [String, Numeric] Raw sharding id