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.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #_database=(database) ⇒ Object
- #adapter ⇒ Object
- #adapter_class_method ⇒ Object
- #adapter_method ⇒ Object
- #checkout_timeout ⇒ Object
- #database ⇒ Object
- #for_current_env? ⇒ Boolean
- #host ⇒ Object
- #idle_timeout ⇒ Object
-
#initialize(env_name, name) ⇒ DatabaseConfig
constructor
A new instance of DatabaseConfig.
- #max_queue ⇒ Object
- #max_threads ⇒ Object
- #migrations_paths ⇒ Object
- #min_threads ⇒ Object
- #pool ⇒ Object
- #reaping_frequency ⇒ Object
- #replica? ⇒ Boolean
- #schema_cache_path ⇒ Object
Constructor Details
#initialize(env_name, name) ⇒ DatabaseConfig
Returns a new instance of DatabaseConfig.
11 12 13 14 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 11 def initialize(env_name, name) @env_name = env_name @name = 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 |
#name ⇒ Object (readonly)
Returns the value of attribute name
9 10 11 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 9 def name @name end |
Instance Method Details
#_database=(database) ⇒ Object
32 33 34 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 32 def _database=(database) raise NotImplementedError end |
#adapter ⇒ Object
36 37 38 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 36 def adapter raise NotImplementedError end |
#adapter_class_method ⇒ Object
20 21 22 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 20 def adapter_class_method "#{adapter}_adapter_class" end |
#adapter_method ⇒ Object
16 17 18 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 16 def adapter_method "#{adapter}_connection" end |
#checkout_timeout ⇒ Object
56 57 58 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 56 def checkout_timeout raise NotImplementedError end |
#database ⇒ Object
28 29 30 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 28 def database raise NotImplementedError end |
#for_current_env? ⇒ Boolean
76 77 78 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 76 def for_current_env? env_name == ActiveRecord::ConnectionHandling::DEFAULT_ENV.call end |
#host ⇒ Object
24 25 26 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 24 def host raise NotImplementedError end |
#idle_timeout ⇒ Object
64 65 66 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 64 def idle_timeout raise NotImplementedError end |
#max_queue ⇒ Object
52 53 54 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 52 def max_queue raise NotImplementedError end |
#max_threads ⇒ Object
48 49 50 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 48 def max_threads raise NotImplementedError end |
#migrations_paths ⇒ Object
72 73 74 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 72 def migrations_paths raise NotImplementedError end |
#min_threads ⇒ Object
44 45 46 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 44 def min_threads raise NotImplementedError end |
#pool ⇒ Object
40 41 42 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 40 def pool raise NotImplementedError end |
#reaping_frequency ⇒ Object
60 61 62 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 60 def reaping_frequency raise NotImplementedError end |
#replica? ⇒ Boolean
68 69 70 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 68 def replica? raise NotImplementedError end |
#schema_cache_path ⇒ Object
80 81 82 |
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 80 def schema_cache_path raise NotImplementedError end |