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.



13
14
15
16
# File '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 '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

#owner_nameObject

Returns the value of attribute owner_name.



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

def owner_name
  @owner_name
end

Instance Method Details

#_database=(database) ⇒ Object

Raises:

  • (NotImplementedError)


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

def _database=(database)
  raise NotImplementedError
end

#adapterObject

Raises:

  • (NotImplementedError)


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

def adapter
  raise NotImplementedError
end

#adapter_methodObject



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

def adapter_method
  "#{adapter}_connection"
end

#checkout_timeoutObject

Raises:

  • (NotImplementedError)


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

def checkout_timeout
  raise NotImplementedError
end

#configObject

Raises:

  • (NotImplementedError)


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

def config
  raise NotImplementedError
end

#databaseObject

Raises:

  • (NotImplementedError)


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

def database
  raise NotImplementedError
end

#for_current_env?Boolean

Returns:

  • (Boolean)


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

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

#hostObject

Raises:

  • (NotImplementedError)


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

def host
  raise NotImplementedError
end

#idle_timeoutObject

Raises:

  • (NotImplementedError)


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

def idle_timeout
  raise NotImplementedError
end

#migrations_pathsObject

Raises:

  • (NotImplementedError)


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

def migrations_paths
  raise NotImplementedError
end

#poolObject

Raises:

  • (NotImplementedError)


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

def pool
  raise NotImplementedError
end

#reaping_frequencyObject

Raises:

  • (NotImplementedError)


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

def reaping_frequency
  raise NotImplementedError
end

#replica?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


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

def replica?
  raise NotImplementedError
end

#schema_cache_pathObject

Raises:

  • (NotImplementedError)


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

def schema_cache_path
  raise NotImplementedError
end

#spec_nameObject



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

def spec_name
  @name
end