Sha256: bcc796d162aa9ec8d57d4c9f23f6f7ff2afef558243e26f210532ece1ceaac61

Contents?: true

Size: 650 Bytes

Versions: 4

Compression:

Stored size: 650 Bytes

Contents

# frozen_string_literal: true

module FreshConnection
  class ConnectionSpecification
    module Rails61
      def spec
        db_config = ActiveRecord::DatabaseConfigurations::HashConfig.new(@spec_name.to_sym, ActiveRecord::Base.connection_pool.db_config.name, build_config)
        ActiveRecord::ConnectionAdapters::PoolConfig.new(ActiveRecord::Base, db_config)
      end

      private

      def config_from_url
        ActiveRecord::DatabaseConfigurations::ConnectionUrlResolver.new(database_group_url).to_hash
      end

      def base_config
        ActiveRecord::Base.connection_pool.db_config.configuration_hash
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fresh_connection-3.1.3 lib/fresh_connection/connection_specification/rails_61.rb
fresh_connection-3.1.2 lib/fresh_connection/connection_specification/rails_61.rb
fresh_connection-3.1.1 lib/fresh_connection/connection_specification/rails_61.rb
fresh_connection-3.1.1.rc1 lib/fresh_connection/connection_specification/rails_61.rb