Skip to content

Instantly share code, notes, and snippets.

@partydrone
Last active July 16, 2017 04:19
Show Gist options
  • Save partydrone/c9252e39b6ed52501d0b to your computer and use it in GitHub Desktop.
Save partydrone/c9252e39b6ed52501d0b to your computer and use it in GitHub Desktop.
Rails database.yml configuration for multiple git branches
<% branch = Git.open(".").current_branch %>
default: &default
adapter: postgresql
encoding: unicode
pool: 5
development:
<<: *default
database: app_development-<%= branch %>
test:
<<: *default
database: app_test-<%= branch %>
production:
<<: *default
database: app_production
group :development, :test do
gem "git"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment