-
-
Save hone/3a15d6b13aa404dbb41d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git diff | |
diff --git a/lib/mongoid/railtie.rb b/lib/mongoid/railtie.rb | |
index 1a2cf40..d8132b0 100644 | |
--- a/lib/mongoid/railtie.rb | |
+++ b/lib/mongoid/railtie.rb | |
@@ -60,7 +60,11 @@ module Rails #:nodoc: | |
initializer "setup database" do | |
config_file = Rails.root.join("config", "mongoid.yml") | |
if config_file.file? | |
- ::Mongoid.load!(config_file) | |
+ begin | |
+ ::Mongoid.load!(config_file) | |
+ rescue Mongo::ConnectionFailure => e | |
+ $stderr.puts "\n#{e.message}" | |
+ end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment