Sha256: ee0913d331d64ef664f7da724dbad50999db69d7e6ae83d4a76c24586cea085f

Contents?: true

Size: 639 Bytes

Versions: 1

Compression:

Stored size: 639 Bytes

Contents

require 'active_support/deprecation'
require 'fresh_connection/connection_specification'

module FreshConnection
  class ConnectionFactory
    def initialize(group, modify_spec = nil)
      deprecation_warn
      @spec = FreshConnection::ConnectionSpecification.new(group, modify_spec: modify_spec)
    end

    def new_connection
      deprecation_warn
      ActiveRecord::Base.__send__(@spec.adapter_method, @spec.confg)
    end

    private

    def deprecation_warn
      ActiveSupport::Deprecation.warn(
        "`FreshConnection::ConnectionFactory` class is deprecated and will removed from version 2.5.0."
      )
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fresh_connection-2.4.0.rc1 lib/fresh_connection/connection_factory.rb