Class: ActiveRecord::DatabaseConfigurations::DatabaseConfig
- Defined in:
- activerecord/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
Returns the value of attribute env_name.
-
#owner_name ⇒ Object
Returns the value of attribute owner_name.
-
#spec_name ⇒ Object
readonly
Returns the value of attribute spec_name.
Instance Method Summary collapse
- #adapter ⇒ Object
- #adapter_method ⇒ Object
- #checkout_timeout ⇒ Object
- #config ⇒ Object
- #database ⇒ Object
- #for_current_env? ⇒ Boolean
- #host ⇒ Object
- #idle_timeout ⇒ Object
-
#initialize(env_name, spec_name) ⇒ DatabaseConfig
constructor
A new instance of DatabaseConfig.
- #migrations_paths ⇒ Object
- #pool ⇒ Object
- #reaping_frequency ⇒ Object
- #replica? ⇒ Boolean
Constructor Details
#initialize(env_name, spec_name) ⇒ DatabaseConfig
Returns a new instance of DatabaseConfig.
12 13 14 15 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 12 def initialize(env_name, spec_name) @env_name = env_name @spec_name = spec_name end |
Instance Attribute Details
#env_name ⇒ Object (readonly)
Returns the value of attribute env_name
9 10 11 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 9 def env_name @env_name end |
#owner_name ⇒ Object
Returns the value of attribute owner_name
10 11 12 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 10 def owner_name @owner_name end |
#spec_name ⇒ Object (readonly)
Returns the value of attribute spec_name
9 10 11 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 9 def spec_name @spec_name end |
Instance Method Details
#adapter ⇒ Object
33 34 35 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 33 def adapter raise NotImplementedError end |
#adapter_method ⇒ Object
21 22 23 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 21 def adapter_method "#{adapter}_connection" end |
#checkout_timeout ⇒ Object
41 42 43 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 41 def checkout_timeout raise NotImplementedError end |
#config ⇒ Object
17 18 19 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 17 def config raise NotImplementedError end |
#database ⇒ Object
29 30 31 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 29 def database raise NotImplementedError end |
#for_current_env? ⇒ Boolean
61 62 63 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 61 def for_current_env? env_name == ActiveRecord::ConnectionHandling::DEFAULT_ENV.call end |
#host ⇒ Object
25 26 27 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 25 def host raise NotImplementedError end |
#idle_timeout ⇒ Object
49 50 51 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 49 def idle_timeout raise NotImplementedError end |
#migrations_paths ⇒ Object
57 58 59 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 57 def migrations_paths raise NotImplementedError end |
#pool ⇒ Object
37 38 39 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 37 def pool raise NotImplementedError end |
#reaping_frequency ⇒ Object
45 46 47 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 45 def reaping_frequency raise NotImplementedError end |
#replica? ⇒ Boolean
53 54 55 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 53 def replica? raise NotImplementedError end |