lib/tasks/db_dump.rake in daddy-0.9.2 vs lib/tasks/db_dump.rake in daddy-0.9.3
- old
+ new
@@ -5,10 +5,11 @@
desc "データベースをダンプします。"
task :dump do
dump_dir = ENV['DUMP_DIR'] || ask('出力先ディレクトリ', :required => true)
- config = YAML.load_file(File.join('config', 'database.yml'))[Rails.env]
+ config = YAML.load(ERB.new(File.read('config/database.yml'), 0, '-').result)[Rails.env]
+
host = config['host'] || 'localhost'
database = config['database']
user = config['username']
password = config['password']