Commit 31b73b6b authored by Vaz Allen's avatar Vaz Allen

Automatic db config in production from DATABASE_URL

parent 74898c05
......@@ -11,16 +11,10 @@ configure :development, :test do
end
configure :production do
db = URI.parse(ENV['DATABASE_URL']) # standard heroku environment variable for configuring the database
set :database, {
:adapter => db.scheme == 'postgres' ? 'postgresql' : db.scheme,
:host => db.host,
:username => db.user,
:password => db.password,
:database => db.path[1..-1],
:encoding => 'utf8'
}
# Database connection is configured automatically based on the DATABASE_URL
# environment variable. This is a feature of sinatra/activerecord support.
#
# If you're deploying to Heroku this will be set automatically.
end
configure do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment