Skip to content

Instantly share code, notes, and snippets.

@brunocruzcoelho
Created January 14, 2014 16:04
Show Gist options
  • Save brunocruzcoelho/8420719 to your computer and use it in GitHub Desktop.
Save brunocruzcoelho/8420719 to your computer and use it in GitHub Desktop.
mongoid config to connect to mongohq
<% if EY::Config.get(:mongohq, 'MONGOHQ_URL') %>
<% uri = URI.parse(EY::Config.get(:mongohq, 'MONGOHQ_URL')) %>
staging:
sessions:
default:
database: <%= uri.path.sub('/','') %>
username: <%= uri.user %>
password: <%= uri.password %>
hosts:
- <%= uri.host %>:<%= uri.port %>
options:
read: primary
production:
sessions:
default:
database: <%= uri.path.sub('/','') %>
username: <%= uri.user %>
password: <%= uri.password %>
hosts:
- <%= uri.host %>:<%= uri.port %>
options:
read: primary
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment