Sha256: da1ba9b9d2a28b6225abe9d6f92e51e7a0669a885601e892ebc8e7f22c730a3a

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

require 'active_support/deprecation'

module FreshConnection
  class AbstractConnectionManager
    class << self
      def method_added(name)
        return unless name == :slave_connection

        ActiveSupport::Deprecation.warn(
          "'slave_connection' has been deprecated. use 'replica_connection' insted."
        )
      end
    end

    attr_reader :replica_group

    def initialize(replica_group = "replica")
      replica_group = "replica" if replica_group.to_s == "slave"
      @replica_group = replica_group.to_s
      @replica_group = "replica" if @replica_group.empty?
    end

    def slave_group
      ActiveSupport::Deprecation.warn(
        "'slave_group' is deprecated and will removed from version 2.4.0. use 'replica_group' insted."
      )

      replica_group
    end

    def replica_connection
    end
    undef_method :replica_connection

    def clear_all_connections!
    end
    undef_method :clear_all_connections!

    def put_aside!
    end
    undef_method :put_aside!

    def recovery?
    end
    undef_method :recovery?
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fresh_connection-2.3.0 lib/fresh_connection/abstract_connection_manager.rb