lib/rails/mongoid.rb in mongoid-2.3.3 vs lib/rails/mongoid.rb in mongoid-2.3.4

- old
+ new

@@ -14,16 +14,18 @@ # @return [ Array<String> ] The file names. # # @since 2.1.0 def create_indexes(pattern) Dir.glob(pattern).each do |file| + logger = Logger.new($stdout) begin model = determine_model(file) if model model.create_indexes - Logger.new($stdout).info("Generated indexes for #{model}") + logger.info("Generated indexes for #{model}") end rescue => e + logger.error("ERROR: #{e.message}") end end end # Use the application configuration to get every model and require it, so