Class: Utilio::Database

Inherits:
Object
  • Object
show all
Defined in:
lib/utilio/database.rb

Constant Summary collapse

DEFAULT_OPTS =
{
  environment: nil,
  file: 'config/database.yml'
}

Class Method Summary collapse

Class Method Details

.config(options = {}) ⇒ Object

Load the configuration file from your application root



13
14
15
16
17
18
19
20
21
# File 'lib/utilio/database.rb', line 13

def config options={}
  options = DEFAULT_OPTS.merge(options)
  config = Path.yaml_file(options[:file])
  unless options[:environment].nil? || options[:environment].empty?
    config[options[:environment]]
  else
    config
  end
end