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, spec_name) ⇒ DatabaseConfig

Returns a new instance of DatabaseConfig.



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

def initialize(env_name, spec_name)
  @env_name = env_name
  @spec_name = spec_name
end

Instance Attribute Details

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

#owner_nameObject

Returns the value of attribute owner_name



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

def owner_name
  @owner_name
end

#spec_nameObject (readonly)

Returns the value of attribute spec_name



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

def spec_name
  @spec_name
end

Instance Method Details

#adapterObject

Raises:

  • (NotImplementedError)


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

def adapter
  raise NotImplementedError
end

#adapter_methodObject



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

def adapter_method
  "#{adapter}_connection"
end

#checkout_timeoutObject

Raises:

  • (NotImplementedError)


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

def checkout_timeout
  raise NotImplementedError
end

#configObject

Raises:

  • (NotImplementedError)


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

def config
  raise NotImplementedError
end

#databaseObject

Raises:

  • (NotImplementedError)


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

def database
  raise NotImplementedError
end

#for_current_env?Boolean

Returns:

  • (Boolean)


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

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

#hostObject

Raises:

  • (NotImplementedError)


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

def host
  raise NotImplementedError
end

#idle_timeoutObject

Raises:

  • (NotImplementedError)


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

def idle_timeout
  raise NotImplementedError
end

#migrations_pathsObject

Raises:

  • (NotImplementedError)


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

def migrations_paths
  raise NotImplementedError
end

#poolObject

Raises:

  • (NotImplementedError)


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

def pool
  raise NotImplementedError
end

#reaping_frequencyObject

Raises:

  • (NotImplementedError)


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

def reaping_frequency
  raise NotImplementedError
end

#replica?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


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

def replica?
  raise NotImplementedError
end