Class: ActiveRecord::DatabaseConfigurations::DatabaseConfig

Inherits:
Object
  • Object
show all
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

HashConfig

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject (readonly)

:nodoc:



9
10
11
# File 'lib/active_record/database_configurations/database_config.rb', line 9

def env_name
  @env_name
end

#nameObject (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

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/active_record/database_configurations/database_config.rb', line 32

def _database=(database)
  raise NotImplementedError
end

#adapterObject

Raises:

  • (NotImplementedError)


36
37
38
# File 'lib/active_record/database_configurations/database_config.rb', line 36

def adapter
  raise NotImplementedError
end

#adapter_class_methodObject



20
21
22
# File 'lib/active_record/database_configurations/database_config.rb', line 20

def adapter_class_method
  "#{adapter}_adapter_class"
end

#adapter_methodObject



16
17
18
# File 'lib/active_record/database_configurations/database_config.rb', line 16

def adapter_method
  "#{adapter}_connection"
end

#checkout_timeoutObject

Raises:

  • (NotImplementedError)


60
61
62
# File 'lib/active_record/database_configurations/database_config.rb', line 60

def checkout_timeout
  raise NotImplementedError
end

#databaseObject

Raises:

  • (NotImplementedError)


28
29
30
# File 'lib/active_record/database_configurations/database_config.rb', line 28

def database
  raise NotImplementedError
end

#for_current_env?Boolean

Returns:

  • (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

#hostObject

Raises:

  • (NotImplementedError)


24
25
26
# File 'lib/active_record/database_configurations/database_config.rb', line 24

def host
  raise NotImplementedError
end

#idle_timeoutObject

Raises:

  • (NotImplementedError)


68
69
70
# File 'lib/active_record/database_configurations/database_config.rb', line 68

def idle_timeout
  raise NotImplementedError
end

#max_queueObject

Raises:

  • (NotImplementedError)


52
53
54
# File 'lib/active_record/database_configurations/database_config.rb', line 52

def max_queue
  raise NotImplementedError
end

#max_threadsObject

Raises:

  • (NotImplementedError)


48
49
50
# File 'lib/active_record/database_configurations/database_config.rb', line 48

def max_threads
  raise NotImplementedError
end

#migrations_pathsObject

Raises:

  • (NotImplementedError)


76
77
78
# File 'lib/active_record/database_configurations/database_config.rb', line 76

def migrations_paths
  raise NotImplementedError
end

#min_threadsObject

Raises:

  • (NotImplementedError)


44
45
46
# File 'lib/active_record/database_configurations/database_config.rb', line 44

def min_threads
  raise NotImplementedError
end

#poolObject

Raises:

  • (NotImplementedError)


40
41
42
# File 'lib/active_record/database_configurations/database_config.rb', line 40

def pool
  raise NotImplementedError
end

#query_cacheObject

Raises:

  • (NotImplementedError)


56
57
58
# File 'lib/active_record/database_configurations/database_config.rb', line 56

def query_cache
  raise NotImplementedError
end

#reaping_frequencyObject

Raises:

  • (NotImplementedError)


64
65
66
# File 'lib/active_record/database_configurations/database_config.rb', line 64

def reaping_frequency
  raise NotImplementedError
end

#replica?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


72
73
74
# File 'lib/active_record/database_configurations/database_config.rb', line 72

def replica?
  raise NotImplementedError
end

#schema_cache_pathObject

Raises:

  • (NotImplementedError)


84
85
86
# File 'lib/active_record/database_configurations/database_config.rb', line 84

def schema_cache_path
  raise NotImplementedError
end