Commit bc0a46d293b6d0c0ece747b45b2aefb2ecc5cfcf

Authored by Stephen Crosby
1 parent 42dcb09c
Exists in master and in 1 other branch production

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: {
... ...