Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shared: &shared
- # Use different adapters with JRuby vs. MRI
- adapter: <%= defined?(JRuby) ? "jdbcmysql" : "mysql" %>
- encoding: utf8
- username: root
- password:
- host: localhost
- socket: /opt/local/var/run/mysql5/mysqld.sock
- <%
- # For the git branches listed in DB_BRANCHES, use a dev DB with the same name.
- # For other branches, use the DEFAULT_DB.
- DEFAULT_DB = 'myproject_dev'
- DB_BRANCHES = %w[ t123 t456 ]
- branch = `git symbolic-ref HEAD 2> /dev/null`.chomp.split('/').last
- dev_db = DB_BRANCHES.include?(branch) ? branch : DEFAULT_DB
- puts "Using dev database: #{dev_db.inspect}"
- %>
- development:
- <<: *shared
- database: <%= dev_db %>
Add Comment
Please, Sign In to add comment