Created
April 29, 2011 01:41
-
-
Save warrenseen/947695 to your computer and use it in GitHub Desktop.
Different DBs depending on git branch
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
<% | |
# Adds the current GIT repo to the database name. | |
parts = [ `git symbolic-ref HEAD 2>/dev/null`.chomp.sub('refs/heads/', ''), ENV['TEST_ENV'] ].compact | |
suffix = parts.length == 0 ? "" : "_#{parts.join("_")}" | |
%> | |
development: | |
adapter: postgresql | |
encoding: unicode | |
pool: 5 | |
username: username | |
password: password | |
database: myapp_development<%= suffix %> | |
test: &test | |
adapter: postgresql | |
encoding: unicode | |
pool: 5 | |
username: username | |
password: password | |
database: myapp_test<%= suffix %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment