lib/mongo_mapper.rb in mongo_mapper-0.5.0 vs lib/mongo_mapper.rb in mongo_mapper-0.5.1
- old
+ new
@@ -8,11 +8,10 @@
require 'mongo'
require 'validatable'
module MongoMapper
DocumentNotFound = Class.new(StandardError)
-
DocumentNotValid = Class.new(StandardError) do
def initialize(document)
@document = document
super("Validation failed: #{@document.errors.full_messages.join(", ")}")
end
@@ -22,9 +21,13 @@
@@connection ||= Mongo::Connection.new
end
def self.connection=(new_connection)
@@connection = new_connection
+ end
+
+ def self.logger
+ connection.logger
end
def self.database=(name)
@@database = nil
@@database_name = name
\ No newline at end of file