123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::DatabaseConfigurations::DatabaseConfig

Do not use. This class is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Inherits: Object
Defined in: activerecord/lib/active_record/database_configurations/database_config.rb

Overview

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 Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(env_name, name) ⇒ DatabaseConfig

[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 11

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

Instance Attribute Details

#_database=(database) (writeonly)

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 43

def _database=(database)
  raise NotImplementedError
end

#env_name (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 9

attr_reader :env_name, :name

#for_current_env?Boolean (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 91

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

#name (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 9

attr_reader :env_name, :name

#replica?Boolean (readonly)

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 83

def replica?
  raise NotImplementedError
end

#seeds?Boolean (readonly)

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 103

def seeds?
  raise NotImplementedError
end

#use_metadata_table?Boolean (readonly)

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 99

def 
  raise NotImplementedError
end

Instance Method Details

#adapter

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 47

def adapter
  raise NotImplementedError
end

#adapter_class

[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 17

def adapter_class
  @adapter_class ||= ActiveRecord::ConnectionAdapters.resolve(adapter)
end

#checkout_timeout

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 71

def checkout_timeout
  raise NotImplementedError
end

#database

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 39

def database
  raise NotImplementedError
end

#host

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 35

def host
  raise NotImplementedError
end

#idle_timeout

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 79

def idle_timeout
  raise NotImplementedError
end

#inspect

[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 21

def inspect # :nodoc:
  "#<#{self.class.name} env_name=#{@env_name} name=#{@name} adapter_class=#{adapter_class}>"
end

#max_queue

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 63

def max_queue
  raise NotImplementedError
end

#max_threads

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 59

def max_threads
  raise NotImplementedError
end

#migrations_paths

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 87

def migrations_paths
  raise NotImplementedError
end

#min_threads

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 55

def min_threads
  raise NotImplementedError
end

#new_connection

[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 25

def new_connection
  adapter_class.new(configuration_hash)
end

#pool

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 51

def pool
  raise NotImplementedError
end

#query_cache

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 67

def query_cache
  raise NotImplementedError
end

#reaping_frequency

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 75

def reaping_frequency
  raise NotImplementedError
end

#schema_cache_path

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 95

def schema_cache_path
  raise NotImplementedError
end

#validate!

[ GitHub ]

  
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 29

def validate!
  adapter_class if adapter

  true
end