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:.
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
- #query_cache ⇒ 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 '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)
: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 |
Instance Method Details
#_database=(database) ⇒ Object
32 33 34 |
# File 'lib/active_record/database_configurations/database_config.rb', line 32 def _database=(database) raise NotImplementedError end |
#adapter ⇒ Object
36 37 38 |
# File 'lib/active_record/database_configurations/database_config.rb', line 36 def adapter raise NotImplementedError end |
#adapter_class_method ⇒ Object
20 21 22 |
# File '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 'lib/active_record/database_configurations/database_config.rb', line 16 def adapter_method "#{adapter}_connection" end |
#checkout_timeout ⇒ Object
60 61 62 |
# File 'lib/active_record/database_configurations/database_config.rb', line 60 def checkout_timeout raise NotImplementedError end |
#database ⇒ Object
28 29 30 |
# File 'lib/active_record/database_configurations/database_config.rb', line 28 def database raise NotImplementedError end |
#for_current_env? ⇒ Boolean
80 81 82 |
# File 'lib/active_record/database_configurations/database_config.rb', line 80 def for_current_env? env_name == ActiveRecord::ConnectionHandling::DEFAULT_ENV.call end |
#host ⇒ Object
24 25 26 |
# File 'lib/active_record/database_configurations/database_config.rb', line 24 def host raise NotImplementedError end |
#idle_timeout ⇒ Object
68 69 70 |
# File 'lib/active_record/database_configurations/database_config.rb', line 68 def idle_timeout raise NotImplementedError end |
#max_queue ⇒ Object
52 53 54 |
# File 'lib/active_record/database_configurations/database_config.rb', line 52 def max_queue raise NotImplementedError end |
#max_threads ⇒ Object
48 49 50 |
# File 'lib/active_record/database_configurations/database_config.rb', line 48 def max_threads raise NotImplementedError end |
#migrations_paths ⇒ Object
76 77 78 |
# File 'lib/active_record/database_configurations/database_config.rb', line 76 def migrations_paths raise NotImplementedError end |
#min_threads ⇒ Object
44 45 46 |
# File 'lib/active_record/database_configurations/database_config.rb', line 44 def min_threads raise NotImplementedError end |
#pool ⇒ Object
40 41 42 |
# File 'lib/active_record/database_configurations/database_config.rb', line 40 def pool raise NotImplementedError end |
#query_cache ⇒ Object
56 57 58 |
# File 'lib/active_record/database_configurations/database_config.rb', line 56 def query_cache raise NotImplementedError end |
#reaping_frequency ⇒ Object
64 65 66 |
# File 'lib/active_record/database_configurations/database_config.rb', line 64 def reaping_frequency raise NotImplementedError end |
#replica? ⇒ Boolean
72 73 74 |
# File 'lib/active_record/database_configurations/database_config.rb', line 72 def replica? raise NotImplementedError end |
#schema_cache_path ⇒ Object
84 85 86 |
# File 'lib/active_record/database_configurations/database_config.rb', line 84 def schema_cache_path raise NotImplementedError end |