Class: ActiveRecord::DatabaseConfigurations::DatabaseConfig

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

HashConfig

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env_name, name) ⇒ DatabaseConfig

Returns a new instance of DatabaseConfig.


13
14
15
16
# File 'activerecord/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_nameObject (readonly)

:nodoc:


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

def env_name
  @env_name
end

#nameObject (readonly)

:nodoc:


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

def name
  @name
end

#owner_nameObject

Returns the value of attribute owner_name.


11
12
13
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 11

def owner_name
  @owner_name
end

Instance Method Details

#_database=(database) ⇒ Object

Raises:

  • (NotImplementedError)

30
31
32
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 30

def _database=(database)
  raise NotImplementedError
end

#adapterObject

Raises:

  • (NotImplementedError)

34
35
36
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 34

def adapter
  raise NotImplementedError
end

#adapter_methodObject


18
19
20
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 18

def adapter_method
  "#{adapter}_connection"
end

#checkout_timeoutObject

Raises:

  • (NotImplementedError)

54
55
56
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 54

def checkout_timeout
  raise NotImplementedError
end

#databaseObject

Raises:

  • (NotImplementedError)

26
27
28
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 26

def database
  raise NotImplementedError
end

#for_current_env?Boolean

Returns:

  • (Boolean)

74
75
76
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 74

def for_current_env?
  env_name == ActiveRecord::ConnectionHandling::DEFAULT_ENV.call
end

#hostObject

Raises:

  • (NotImplementedError)

22
23
24
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 22

def host
  raise NotImplementedError
end

#idle_timeoutObject

Raises:

  • (NotImplementedError)

62
63
64
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 62

def idle_timeout
  raise NotImplementedError
end

#max_queueObject

Raises:

  • (NotImplementedError)

50
51
52
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 50

def max_queue
  raise NotImplementedError
end

#max_threadsObject

Raises:

  • (NotImplementedError)

46
47
48
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 46

def max_threads
  raise NotImplementedError
end

#migrations_pathsObject

Raises:

  • (NotImplementedError)

70
71
72
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 70

def migrations_paths
  raise NotImplementedError
end

#min_threadsObject

Raises:

  • (NotImplementedError)

42
43
44
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 42

def min_threads
  raise NotImplementedError
end

#poolObject

Raises:

  • (NotImplementedError)

38
39
40
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 38

def pool
  raise NotImplementedError
end

#reaping_frequencyObject

Raises:

  • (NotImplementedError)

58
59
60
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 58

def reaping_frequency
  raise NotImplementedError
end

#replica?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)

66
67
68
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 66

def replica?
  raise NotImplementedError
end

#schema_cache_pathObject

Raises:

  • (NotImplementedError)

78
79
80
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 78

def schema_cache_path
  raise NotImplementedError
end