trugul-bot/environments.rb

18 lines
438 B
Ruby
Raw Normal View History

2015-04-15 11:00:32 -04:00
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