Created
February 10, 2010 22:01
-
-
Save jacqui/300901 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 'rubygems' | |
require 'pp' | |
unless self.class.const_defined? "IRB_RC_HAS_LOADED" | |
begin # db connection helpers | |
def some_db | |
ActiveRecord::Base.establish_connection(:adapter => 'mysql', :username => 'root', :database => 'some_database') | |
end | |
def prod_db | |
ActiveRecord::Base.establish_connection(:adapter => 'mysql', :username => 'root', :database => 'app_production') | |
end | |
def dev_db | |
ActiveRecord::Base.establish_connection(:adapter => 'mysql', :username => 'root', :database => 'app_development') | |
end | |
def current_db | |
ActiveRecord::Base.connection.current_database | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment