Created
November 11, 2011 00:42
-
-
Save dandemeyere/1356765 to your computer and use it in GitHub Desktop.
ActiveRecord DB Setup File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
env = ENV["RACK_ENV"] | |
YAML::load(File.open('config/database.yml'))[env].symbolize_keys.each do |key, value| | |
set key, value | |
end | |
ActiveRecord::Base.establish_connection( | |
adapter: "mysql2", | |
host: settings.db_host, | |
database: settings.db_name, | |
username: settings.db_username, | |
password: settings.db_password) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment