noosfero | allows erb templates in_database.yml (472a65c0)

Evandro Jr gitlab at mg.gitlab.com
Wed Dec 30 16:08:18 BRST 2015


New comment for Commit 472a65c0

https://gitlab.com/noosfero/noosfero/commit/472a65c0e5f123c29c8e84b1ae33d29bcee3ed3f#note_3087143


Author: Evandro Jr

This MR will allows us to do use erb templating syntax inside config/database.yml

Example:

<%
  # http://mislav.uniqpath.com/rails/branching-the-database-along-with-your-code/
  app = "noosfero"
  branch = `git symbolic-ref HEAD 2>/dev/null`.chomp.sub('refs/heads/', '')
  user = (`whoami`).gsub(/\W/, '')
%>
development:
  adapter: postgresql
  encoding: unicode
  database: <%= "#{app}_#{branch}_development" %>
  template: template0
  username: <%= user %>
  password:


Did not break any test that was passing before:

Before:
https://travis-ci.org/noosfero/noosfero/builds/99440879

After:
https://travis-ci.org/evandrojr/noosferogov/jobs/99462155

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20151230/2d1fdf26/attachment.html>


More information about the Noosfero-dev mailing list