trugul-bot/environments.rb
2015-04-26 10:17:53 -04:00

31 lines
709 B
Ruby

require 'rubygems'
require 'bundler'
Bundler.require
require 'will_paginate'
require 'will_paginate/active_record'
include WillPaginate::Sinatra::Helpers
require './models/raid'
require './models/leader'
require './helpers/raids_helper'
require './jobs/leaders'
configure :development do
set :database, 'sqlite3:dev.db'
set :show_exceptions, true
end
configure :production do
db = URI.parse(ENV['DATABASE_URL'] || 'postgres:///localhost/mydb')
ActiveRecord::Base.establish_connection(
:adapter => db.scheme == 'postgres' ? 'postgresql' : db.scheme,
:host => db.host,
:username => db.user,
:password => db.password,
:database => db.path[1..-1],
:encoding => 'utf8'
)
end