Skip to content

Instantly share code, notes, and snippets.

@maxy
Created September 19, 2014 02:29
Show Gist options
  • Select an option

  • Save maxy/e1d8d6ab86278a1da90a to your computer and use it in GitHub Desktop.

Select an option

Save maxy/e1d8d6ab86278a1da90a to your computer and use it in GitHub Desktop.

Revisions

  1. maxy created this gist Sep 19, 2014.
    10 changes: 10 additions & 0 deletions database.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    development:
    adapter: postgres
    database: DATABASE_NAME
    pool: 5
    timeout: 5000
    username: <%= ENV['PG_USER'] || 'postgres' %>
    password: <%= ENV['PG_PASSWORD'] || '' %>
    host: <%= ENV['PG_HOST'] || 'localhost' %>
    port: <%= ENV['PG_PORT'] || 5432 %>
    encoding: utf8
    3 changes: 3 additions & 0 deletions load_config.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    env = ENV['ENVIRONMENT'] || 'development'
    YAML.load(ERB.new(File.read('database.yml')).result)[env]