Commit f2e954339eece36eafbd85bab7021efac4e0e857
1 parent
2e24aeb2
Exists in
master
and in
1 other branch
Avoid setting MongoDB all the time
We can have no env variable. So we don't need configure Mongoid see #461
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
config/initializers/mongo.rb
... | ... | @@ -3,7 +3,7 @@ config_file = Rails.root.join("config", "mongoid.yml") |
3 | 3 | if config_file.file? && |
4 | 4 | YAML.load(ERB.new(File.read(config_file)).result)[Rails.env].values.flatten.any? |
5 | 5 | ::Mongoid.load!(config_file) |
6 | -else | |
6 | +elsif ENV['HEROKU'] || ENV['USE_ENV'] | |
7 | 7 | # No mongoid.yml file. Use ENV variable to define your MongoDB |
8 | 8 | # configuration |
9 | 9 | if mongo = ENV['MONGOLAB_URI'] || ENV['MONGOHQ_URL'] | ... | ... |