lib/mongodoc/connection.rb in mongodoc-0.0.0 vs lib/mongodoc/connection.rb in mongodoc-0.1.0
- old
+ new
@@ -1,16 +1,16 @@
module MongoDoc
def self.database(name = nil)
if name
@@database = connection.db(name)
else
- raise NoDatabaseError unless defined? @@database
+ raise NoDatabaseError unless defined? @@database and @@database
@@database
end
end
def self.connection
- raise NoConnectionError unless defined? @@connection
+ raise NoConnectionError unless defined? @@connection and @@connection
@@connection
end
def self.connect(*args)
opts = args.extract_options!
\ No newline at end of file