Sha256: 497af5726303e9fa6a504ff9b15bafca5f3b06c9b08ee83c82d57eb525e64bbc

Contents?: true

Size: 736 Bytes

Versions: 2

Compression:

Stored size: 736 Bytes

Contents

# frozen_string_literal: true

module ChronoModel
  module Patches
    module DBConsole
      module Config
        def config
          super.dup.tap { |config| config['adapter'] = 'postgresql/chronomodel' }
        end
      end

      module DbConfig
        def db_config
          return @patched_db_config if @patched_db_config

          original_db_config = super
          patched_db_configuration_hash = original_db_config.configuration_hash.dup.tap do |config|
            config[:adapter] = 'postgresql/chronomodel'
          end
          original_db_config.instance_variable_set :@configuration_hash, patched_db_configuration_hash

          @patched_db_config = original_db_config
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chrono_model-3.0.1 lib/chrono_model/patches/db_console.rb
chrono_model-2.0.0 lib/chrono_model/patches/db_console.rb