Sha256: 994d35c0be91fde2d0ffbdd0b249e4e142d40ab0848b6203ea081f8a47e5cbe8

Contents?: true

Size: 1.62 KB

Versions: 40

Compression:

Stored size: 1.62 KB

Contents

# frozen_string_literal: true

module ActiveRecord
  class DatabaseConfigurations
    # ActiveRecord::Base.configurations will return either a HashConfig or
    # UrlConfig respectively. It will never return a DatabaseConfig object,
    # as this is the parent class for the types of database configuration objects.
    class DatabaseConfig # :nodoc:
      attr_reader :env_name, :name

      attr_accessor :owner_name

      def initialize(env_name, name)
        @env_name = env_name
        @name = name
      end

      def adapter_method
        "#{adapter}_connection"
      end

      def host
        raise NotImplementedError
      end

      def database
        raise NotImplementedError
      end

      def _database=(database)
        raise NotImplementedError
      end

      def adapter
        raise NotImplementedError
      end

      def pool
        raise NotImplementedError
      end

      def min_threads
        raise NotImplementedError
      end

      def max_threads
        raise NotImplementedError
      end

      def max_queue
        raise NotImplementedError
      end

      def checkout_timeout
        raise NotImplementedError
      end

      def reaping_frequency
        raise NotImplementedError
      end

      def idle_timeout
        raise NotImplementedError
      end

      def replica?
        raise NotImplementedError
      end

      def migrations_paths
        raise NotImplementedError
      end

      def for_current_env?
        env_name == ActiveRecord::ConnectionHandling::DEFAULT_ENV.call
      end

      def schema_cache_path
        raise NotImplementedError
      end
    end
  end
end

Version data entries

40 entries across 38 versions & 5 rubygems

Version Path
activerecord-7.0.8.7 lib/active_record/database_configurations/database_config.rb
activerecord-7.0.8.6 lib/active_record/database_configurations/database_config.rb
activerecord-7.0.8.5 lib/active_record/database_configurations/database_config.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8.4/lib/active_record/database_configurations/database_config.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.5.1/lib/active_record/database_configurations/database_config.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.5.1/lib/active_record/database_configurations/database_config.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.5.1/lib/active_record/database_configurations/database_config.rb
activerecord-7.0.8.4 lib/active_record/database_configurations/database_config.rb
activerecord-7.0.8.1 lib/active_record/database_configurations/database_config.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/activerecord-7.0.3.1/lib/active_record/database_configurations/database_config.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/activerecord-7.0.2.3/lib/active_record/database_configurations/database_config.rb
activerecord-7.0.8 lib/active_record/database_configurations/database_config.rb
activerecord-7.0.7.2 lib/active_record/database_configurations/database_config.rb
activerecord-7.0.7.1 lib/active_record/database_configurations/database_config.rb
activerecord-7.0.7 lib/active_record/database_configurations/database_config.rb
activerecord-7.0.6 lib/active_record/database_configurations/database_config.rb
activerecord-7.0.5.1 lib/active_record/database_configurations/database_config.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/activerecord-7.0.3.1/lib/active_record/database_configurations/database_config.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/activerecord-7.0.2.3/lib/active_record/database_configurations/database_config.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/database_configurations/database_config.rb