Class: ActiveRecord::DatabaseConfigurations::DatabaseConfig
- Inherits:
-
Object
- Object
- ActiveRecord::DatabaseConfigurations::DatabaseConfig
- Defined in:
- lib/active_record/database_configurations/database_config.rb
Overview
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.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#env_name ⇒ Object
readonly
:nodoc:.
-
#name ⇒ Object
readonly
:nodoc:.
-
#owner_name ⇒ Object
Returns the value of attribute owner_name.
Instance Method Summary collapse
- #_database=(database) ⇒ Object
- #adapter ⇒ Object
- #adapter_method ⇒ Object
- #checkout_timeout ⇒ Object
- #config ⇒ Object
- #database ⇒ Object
- #for_current_env? ⇒ Boolean
- #host ⇒ Object
- #idle_timeout ⇒ Object
-
#initialize(env_name, name) ⇒ DatabaseConfig
constructor
A new instance of DatabaseConfig.
- #migrations_paths ⇒ Object
- #pool ⇒ Object
- #reaping_frequency ⇒ Object
- #replica? ⇒ Boolean
- #schema_cache_path ⇒ Object
- #spec_name ⇒ Object
Constructor Details
#initialize(env_name, name) ⇒ DatabaseConfig
Returns a new instance of DatabaseConfig.
13 14 15 16 |
# File 'lib/active_record/database_configurations/database_config.rb', line 13 def initialize(env_name, name) @env_name = env_name @name = name end |
Instance Attribute Details
#env_name ⇒ Object (readonly)
:nodoc:
9 10 11 |
# File 'lib/active_record/database_configurations/database_config.rb', line 9 def env_name @env_name end |
#name ⇒ Object (readonly)
:nodoc:
9 10 11 |
# File 'lib/active_record/database_configurations/database_config.rb', line 9 def name @name end |
#owner_name ⇒ Object
Returns the value of attribute owner_name.
11 12 13 |
# File 'lib/active_record/database_configurations/database_config.rb', line 11 def owner_name @owner_name end |
Instance Method Details
#_database=(database) ⇒ Object
39 40 41 |
# File 'lib/active_record/database_configurations/database_config.rb', line 39 def _database=(database) raise NotImplementedError end |
#adapter ⇒ Object
43 44 45 |
# File 'lib/active_record/database_configurations/database_config.rb', line 43 def adapter raise NotImplementedError end |
#adapter_method ⇒ Object
27 28 29 |
# File 'lib/active_record/database_configurations/database_config.rb', line 27 def adapter_method "#{adapter}_connection" end |
#checkout_timeout ⇒ Object
51 52 53 |
# File 'lib/active_record/database_configurations/database_config.rb', line 51 def checkout_timeout raise NotImplementedError end |
#config ⇒ Object
23 24 25 |
# File 'lib/active_record/database_configurations/database_config.rb', line 23 def config raise NotImplementedError end |
#database ⇒ Object
35 36 37 |
# File 'lib/active_record/database_configurations/database_config.rb', line 35 def database raise NotImplementedError end |
#for_current_env? ⇒ Boolean
71 72 73 |
# File 'lib/active_record/database_configurations/database_config.rb', line 71 def for_current_env? env_name == ActiveRecord::ConnectionHandling::DEFAULT_ENV.call end |
#host ⇒ Object
31 32 33 |
# File 'lib/active_record/database_configurations/database_config.rb', line 31 def host raise NotImplementedError end |
#idle_timeout ⇒ Object
59 60 61 |
# File 'lib/active_record/database_configurations/database_config.rb', line 59 def idle_timeout raise NotImplementedError end |
#migrations_paths ⇒ Object
67 68 69 |
# File 'lib/active_record/database_configurations/database_config.rb', line 67 def migrations_paths raise NotImplementedError end |
#pool ⇒ Object
47 48 49 |
# File 'lib/active_record/database_configurations/database_config.rb', line 47 def pool raise NotImplementedError end |
#reaping_frequency ⇒ Object
55 56 57 |
# File 'lib/active_record/database_configurations/database_config.rb', line 55 def reaping_frequency raise NotImplementedError end |
#replica? ⇒ Boolean
63 64 65 |
# File 'lib/active_record/database_configurations/database_config.rb', line 63 def replica? raise NotImplementedError end |
#schema_cache_path ⇒ Object
75 76 77 |
# File 'lib/active_record/database_configurations/database_config.rb', line 75 def schema_cache_path raise NotImplementedError end |
#spec_name ⇒ Object
18 19 20 |
# File 'lib/active_record/database_configurations/database_config.rb', line 18 def spec_name @name end |