Permalink
Browse files

fixed bug on createInstance

  • Loading branch information...
masylum committed Jan 2, 2011
1 parent d4b1d5a commit 4e5cb8b655aa5d423aec781366cb444a8af429d9
Showing with 4 additions and 2 deletions.
  1. +3 −1 lib/model.js
  2. +1 −1 package.json
View
@@ -99,7 +99,9 @@ module.exports = function (db, collection_name) {
if (!validator.hasErrors()) {
model.onCreateInstance(element, function (error, element) {
model.mongoCall('insert', element, function (error, element) {
- validator.updated_model = element[0];
+ if (element[0]) {
+ validator.updated_model = element[0];
+ }
callback(error, validator);
});
});
View
@@ -1,7 +1,7 @@
{
"name": "mongolia",
"description": "Mongodb driver wrapper. Acts as model.",
- "version": "0.0.7",
+ "version": "0.0.8",
"author": "Pau Ramon <masylum@gmail.com>",
"keywords": ["mongo", "mongodb", "orm", "database", "db"],
"main": "./index",

0 comments on commit 4e5cb8b

Please sign in to comment.