From 83746475629f5945bf70dc45b5976749e6b92d9e Mon Sep 17 00:00:00 2001 From: terry Date: Mon, 22 Feb 2010 15:44:05 -0600 Subject: [PATCH] database url from heroku support --- environment.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/environment.rb b/environment.rb index e130c7e..76fa5c1 100644 --- a/environment.rb +++ b/environment.rb @@ -20,7 +20,8 @@ :url_base => 'http://localhost:4567/' ) - DataMapper.setup(:default, "sqlite3:///#{File.expand_path(File.dirname(__FILE__))}/#{Sinatra::Base.environment}.db") + sqlite3_file = "sqlite3:///#{File.expand_path(File.dirname(__FILE__))}/#{Sinatra::Base.environment}.db" + DataMapper.setup(:default, ENV['DATABASE_URL'] || sqlite3_file) # load models $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/lib")