module DockerizeRails::ConfigLoader

Public Class Methods

app_config() click to toggle source
# File lib/dockerize_rails/config_loader.rb, line 7
def self.app_config
  unless @app_config
    @app_config = YAML.load_file(File.join(PATHS.current, 'config/database.yml'))
    process_app_config
  end
  @app_config
end

Private Class Methods

process_app_config() click to toggle source
# File lib/dockerize_rails/config_loader.rb, line 15
def self.process_app_config
  @app_config.delete 'default'
  @app_config.keys.each do |section|
    current_section = @app_config[section]
    current_section['username'] = DRConfig.database_user_name
    current_section['password'] = DRConfig.database_user_pass
    current_section['database'] = "#{DRConfig.application_name}_#{section}" \
      if DRConfig.database_host_type == Constants::DATABASE_HOST_LINKED
    current_section['host'] = DRConfig.database_host_name
    @app_config[section] = current_section
  end
end