Permalink
Browse files

When loading models, continue with warning if exception is raised

[ fix #2274 ]
  • Loading branch information...
1 parent 3a80b3a commit c3f8bf8ac5f3e7fe87c94def9a2f588ff7299877 @durran durran committed Aug 3, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −1 lib/rails/mongoid.rb
  2. +0 −1 spec/rails/mongoid_spec.rb
@@ -118,7 +118,11 @@ def preload_models(app)
#
# @since 2.0.0.rc.3
def load_model(file)
- require_dependency(file)
+ begin
+ require_dependency(file)
+ rescue Exception => e
+ Logger.new($stdout).warn(e.message)
+ end
end
# Given the provided file name, determine the model and return the class.
@@ -445,6 +445,5 @@ class Tweet
Rails::Mongoid.load_models(app)
end
end
-
end
end

0 comments on commit c3f8bf8

Please sign in to comment.