Commit b3735e840580b4c7821113b4b1cb6d2c3a919f22

Authored by Arthur Nogueira Neves
2 parents 354b428a bc0a46d2
Exists in master and in 1 other branch production

Merge pull request #851 from stevecrozz/multi_host_mongo_uri

stop modifying custom mongo uri
Showing 1 changed file with 6 additions and 5 deletions   Show diff stats
config/mongo.rb
1   -require 'uri'
2   -
3 1 Mongoid.configure do |config|
4   - uri = URI.parse(Errbit::Config.mongo_url)
5   - uri.path = "/errbit_#{Rails.env}" if uri.path.empty?
  2 + if Errbit::Config.mongo_url == 'mongodb://localhost'
  3 + uri = "mongodb://localhost/errbit_#{Rails.env}"
  4 + else
  5 + uri = Errbit::Config.mongo_uri
  6 + end
6 7  
7 8 config.load_configuration({
8 9 sessions: {
9 10 default: {
10   - uri: uri.to_s
  11 + uri: uri
11 12 }
12 13 },
13 14 options: {
... ...