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
- .new(env_name, name) ⇒ DatabaseConfig constructor
Instance Attribute Summary
- #_database=(database) writeonly
- #env_name readonly
- #for_current_env? ⇒ Boolean readonly
- #name readonly
- #replica? ⇒ Boolean readonly
- #seeds? ⇒ Boolean readonly
- #use_metadata_table? ⇒ Boolean readonly
Instance Method Summary
Constructor Details
.new(env_name, name) ⇒ DatabaseConfig
Instance Attribute Details
#_database=(database) (writeonly)
# 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)
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 83
def replica? raise NotImplementedError end
#seeds? ⇒ Boolean
(readonly)
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 103
def seeds? raise NotImplementedError end
#use_metadata_table? ⇒ Boolean
(readonly)
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 99
def raise NotImplementedError end
Instance Method Details
#adapter
# 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
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 71
def checkout_timeout raise NotImplementedError end
#database
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 39
def database raise NotImplementedError end
#host
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 35
def host raise NotImplementedError end
#idle_timeout
# 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
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 63
def max_queue raise NotImplementedError end
#max_threads
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 59
def max_threads raise NotImplementedError end
#migrations_paths
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 87
def migrations_paths raise NotImplementedError end
#min_threads
# 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
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 51
def pool raise NotImplementedError end
#query_cache
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 67
def query_cache raise NotImplementedError end
#reaping_frequency
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 75
def reaping_frequency raise NotImplementedError end
#schema_cache_path
# 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