Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<% branch_name = `git symbolic-ref HEAD 2>/dev/null`.chomp.sub('refs/heads/', '') %>
<% repository_name = `git rev-parse --show-toplevel`.split('/').last.strip %>
default: &default
adapter: postgresql
encoding: unicode
host: localhost
pool: 5
password:
development:
<<: *default
database: <%= "#{repository_name}_development" %>
test:
<<: *default
database: <%= "#{repository_name}_test" %>
staging:
<<: *default
database: <%= "#{repository_name}_staging" %>
production:
<<: *default
database: <%= "#{repository_name}_production" %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment