Skip to content

Instantly share code, notes, and snippets.

@nbibler
Created April 7, 2009 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nbibler/91387 to your computer and use it in GitHub Desktop.
Save nbibler/91387 to your computer and use it in GitHub Desktop.
<%
git_branches = `cd "#{RAILS_ROOT}"; /opt/local/bin/git branch --no-color`
git_branch = git_branches.split("\n").detect { |b| b =~ /\A\*/ }.gsub(/\A\* /, '')
%>
common: &common
adapter: sqlite3
timeout: 5000
development:
<<: *common
database: db/development<%= git_branch ? "_#{git_branch}" : '' %>.sqlite3
test:
<<: *common
database: db/test<%= git_branch ? "_#{git_branch}" : '' %>.sqlite3
production:
<<: *common
database: db/development<%= git_branch ? "_#{git_branch}" : '' %>.sqlite3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment