From 453d90a68ea2bbb6b3320997f445cdb68d696657 Mon Sep 17 00:00:00 2001 From: Adrian Madrid Date: Thu, 4 Dec 2008 17:10:00 -0700 Subject: [PATCH] Added a simple check for a single array passed as the first and only parameter when inserting objects --- lib/mongo/collection.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/mongo/collection.rb b/lib/mongo/collection.rb index 7447941..5fe2f22 100644 --- a/lib/mongo/collection.rb +++ b/lib/mongo/collection.rb @@ -32,6 +32,7 @@ module XGen end def insert(*objects) + objects = objects.first if objects.size == 1 && objects.first.is_a?(Array) @db.insert_into_db(@name, objects) end