diff --git a/lib/mongo.rb b/lib/mongo.rb index 85d7e50..33c7559 100644 --- a/lib/mongo.rb +++ b/lib/mongo.rb @@ -3,7 +3,7 @@ $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) module Mongo - VERSION = "1.0.1" + VERSION = "1.0.2" end module Mongo diff --git a/lib/mongo/db.rb b/lib/mongo/db.rb index 9573d0c..0cdc006 100644 --- a/lib/mongo/db.rb +++ b/lib/mongo/db.rb @@ -87,7 +87,7 @@ module Mongo # # @core authenticate authenticate-instance_method def authenticate(username, password, save_auth=true) - doc = command(:getnonce => 1, :check_response => false) + doc = command({:getnonce => 1}, :check_response => false) raise "error retrieving nonce: #{doc}" unless ok?(doc) nonce = doc['nonce'] @@ -465,7 +465,7 @@ module Mongo sock = old_sock end raise MongoArgumentError, "command must be given a selector" unless selector.is_a?(Hash) && !selector.empty? - if selector.class.eql?(Hash) && selector.keys.length > 1 && RUBY_VERSION < '1.9' + if selector.keys.length > 1 && RUBY_VERSION < '1.9' && selector.class != BSON::OrderedHash raise MongoArgumentError, "DB#command requires an OrderedHash when hash contains multiple keys" end