Created
June 21, 2010 18:39
-
-
Save henrik/447287 to your computer and use it in GitHub Desktop.
Per-branch development database with Git and Ruby on Rails.
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
<% | |
DEFAULT_DB = 'myapp_development' | |
DB_BRANCHES = %w[ t79 ] | |
branch = `git symbolic-ref HEAD 2> /dev/null`.chomp.split('/').last | |
dev_db = DB_BRANCHES.include?(branch) ? branch.gsub(/[^a-zA-Z0-9_]/, '') : DEFAULT_DB | |
puts "Using dev database: #{dev_db.inspect}" | |
%> | |
development: | |
database: <%= dev_db %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment