Sha256: 55d9fdf28037096a73c69f2acf69c1c40427ec46c9bb9d32108b64ce711cba56

Contents?: true

Size: 724 Bytes

Versions: 3

Compression:

Stored size: 724 Bytes

Contents

require 'active_record'
require 'standby/version'
require 'standby/base'
require 'standby/error'
require 'standby/connection_holder'
require 'standby/transaction'
require 'standby/active_record/base'
require 'standby/active_record/connection_handling'
require 'standby/active_record/relation'
require 'standby/active_record/log_subscriber'

module Standby
  class << self
    attr_accessor :disabled

    def standby_connections
      @standby_connections ||= {}
    end

    def on_standby(name = :null_state, &block)
      raise Standby::Error.new('invalid standby target') unless name.is_a?(Symbol)
      Base.new(name).run &block
    end

    def on_primary(&block)
      Base.new(:primary).run &block
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
standby-5.0.0 lib/standby.rb
slavery-4.0.0 lib/standby.rb
standby-4.0.0 lib/standby.rb