Commit 0d03b51c authored by James Sapara's avatar James Sapara

tweaked how we load the database

parent 238eccbc
...@@ -17,6 +17,7 @@ configure do ...@@ -17,6 +17,7 @@ configure do
} }
# Production database settings, tuned for heroku # Production database settings, tuned for heroku
when :production when :production
# Configure from a DATABASE_URL environment variable
db = URI.parse(ENV['DATABASE_URL']) # standard heroku environment variable for configuring the database db = URI.parse(ENV['DATABASE_URL']) # standard heroku environment variable for configuring the database
set :database, { set :database, {
......
...@@ -9,7 +9,6 @@ require 'sinatra/activerecord' ...@@ -9,7 +9,6 @@ require 'sinatra/activerecord'
require 'sinatra/contrib/all' # Requires cookies, among other things require 'sinatra/contrib/all' # Requires cookies, among other things
ENV['RACK_ENV'] ||= 'development' ENV['RACK_ENV'] ||= 'development'
APP_ROOT = Pathname.new(File.expand_path('../../', __FILE__)) APP_ROOT = Pathname.new(File.expand_path('../../', __FILE__))
APP_NAME = APP_ROOT.basename.to_s APP_NAME = APP_ROOT.basename.to_s
...@@ -31,6 +30,10 @@ configure :development, :test do ...@@ -31,6 +30,10 @@ configure :development, :test do
require 'pry' require 'pry'
end end
# Production Sinatra Configuration
configure :production do
# NOOP
end
# Set up the database and models # Set up the database and models
require APP_ROOT.join('config', 'database') require APP_ROOT.join('config', 'database')
......
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