Commit 483bfce282ba19f40a430a42e85a2b8500f33878

Authored by Marcin Ciunelis
2 parents 18b030bd c00f9690
Exists in master and in 1 other branch production

Merge pull request #222 from brycem/mongolab

Changes default heroku config to use MongoLab instead of MongoHQ
README.md
... ... @@ -144,10 +144,10 @@ git clone http://github.com/errbit/errbit.git
144 144 ```bash
145 145 gem install heroku
146 146 heroku create example-errbit --stack cedar
147   -heroku addons:add mongohq:free
148   -cp -f config/mongoid.mongohq.yml config/mongoid.yml
  147 +heroku addons:add mongolab:starter
  148 +cp -f config/mongoid.mongolab.yml config/mongoid.yml
149 149 git add -f config/mongoid.yml
150   -git commit -m "Added mongoid config for MongoHQ"
  150 +git commit -m "Added mongoid config for Mongolab"
151 151 heroku addons:add sendgrid:starter
152 152 heroku config:add HEROKU=true
153 153 heroku config:add ERRBIT_HOST=some-hostname.example.com
... ...
config/initializers/_load_config.rb
... ... @@ -9,7 +9,7 @@ unless defined?(Errbit::Config)
9 9 if ENV['HEROKU']
10 10 Errbit::Config.host = ENV['ERRBIT_HOST']
11 11 Errbit::Config.email_from = ENV['ERRBIT_EMAIL_FROM']
12   - Errbit::Config.email_at_notices = [1,3,10] #ENV['ERRBIT_EMAIL_AT_NOTICES']
  12 + Errbit::Config.email_at_notices = ENV['ERRBIT_EMAIL_AT_NOTICES']
13 13 Errbit::Config.confirm_resolve_err = ENV['ERRBIT_CONFIRM_RESOLVE_ERR']
14 14 Errbit::Config.user_has_username = ENV['ERRBIT_USER_HAS_USERNAME']
15 15 Errbit::Config.allow_comments_with_issue_tracker = ENV['ERRBIT_ALLOW_COMMENTS_WITH_ISSUE_TRACKER']
... ...
config/initializers/mongo.rb
1   -if mongo = ENV['MONGOHQ_URL'] || ENV['MONGOLAB_URI']
  1 +if mongo = ENV['MONGOLAB_URI'] || ENV['MONGOHQ_URL']
2 2 settings = URI.parse(mongo)
3 3 database_name = settings.path.gsub(/^\//, '')
4 4  
... ...
config/mongoid.mongolab.yml 0 → 100644
... ... @@ -0,0 +1,8 @@
  1 +# Mongoid Configuration for MongoLab on Heroku
  2 +# ===========================================
  3 +#
  4 +# Copy this file to config/mongoid.yml,
  5 +# commit it to your repo, then push to heroku.
  6 +
  7 +production:
  8 + uri: <%= ENV['MONGOLAB_URI'] %>
... ...