Class: Rails::Configuration

Inherits:
Object show all
Defined in:
lib/six-updater-web/config/environment.rb

Instance Method Summary collapse

Instance Method Details

#database_configurationObject



30
31
32
33
34
35
36
37
38
39
# File 'lib/six-updater-web/config/environment.rb', line 30

def database_configuration
  conf = File.open(database_configuration_file, 'r') {|file| YAML::load(file)}
  conf.each do |k, v|
    if v["adapter"] =~ /^sqlite/
      v["database"] = File.join(SixUpdaterWeb::DATA_PATH, v["database"]) if v.include?("database")
      v["dbfile"]   = File.join(SixUpdaterWeb::DATA_PATH, v["dbfile"]) if v.include?("dbfile")
    end
  end
  conf
end