Sha256: 0082cff8d01acea6d890657e473287ee1a543b9a23569d7e13303771adba8a3a

Contents?: true

Size: 405 Bytes

Versions: 1

Compression:

Stored size: 405 Bytes

Contents

module DistributeReads
  module AppropriatePool
    def _appropriate_pool(*args)
      if Thread.current[:distribute_reads]
        if needs_master?(*args) || @slave_pool.completely_blacklisted? || in_transaction?
          @master_pool
        else
          @slave_pool
        end
      elsif DistributeReads.default_to_primary
        @master_pool
      else
        super
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
distribute_reads-0.1.0 lib/distribute_reads/appropriate_pool.rb