Comparing version 0.2.0 to 0.2.1
@@ -1,2 +0,2 @@ | ||
// Bookshelf.js 0.2.0 | ||
// Bookshelf.js 0.2.1 | ||
@@ -28,3 +28,3 @@ // (c) 2013 Tim Griesser | ||
// Keep in sync with `package.json`. | ||
Bookshelf.VERSION = '0.2.0'; | ||
Bookshelf.VERSION = '0.2.1'; | ||
@@ -359,4 +359,5 @@ // We're using `Backbone.Events` rather than `EventEmitter`, | ||
if (resp && resp.length > 0) { | ||
model.trigger('fetched', model, resp, options); | ||
return model; | ||
return model.triggerThen('fetched', model, resp, options).then(function() { | ||
return model; | ||
}); | ||
} | ||
@@ -418,5 +419,12 @@ return null; | ||
} | ||
model.trigger((method === 'insert' ? 'created' : 'updated'), model, resp, options); | ||
model.trigger('saved', model, resp, options); | ||
return model._reset(); | ||
// Reset the model's `previousAttributes` and `changed` values. | ||
model._reset(); | ||
return when.all([ | ||
model.trigger((method === 'insert' ? 'created' : 'updated'), model, resp, options), | ||
model.trigger('saved', model, resp, options) | ||
]).then(function() { | ||
return model; | ||
}); | ||
}) | ||
@@ -437,4 +445,6 @@ .ensure(function() { model.resetQuery(); }); | ||
model.clear(); | ||
model.trigger('destroyed', model, resp, options); | ||
return model._reset(); | ||
model._reset(); | ||
return model.triggerThen('destroyed', model, resp, options).then(function() { | ||
return model; | ||
}); | ||
}).ensure(function() { | ||
@@ -613,4 +623,5 @@ model.resetQuery(); | ||
.then(function(resp) { | ||
collection.trigger('fetched', collection, resp, options); | ||
return collection; | ||
return collection.triggerThen('fetched', collection, resp, options).then(function() { | ||
return collection; | ||
}); | ||
}); | ||
@@ -617,0 +628,0 @@ }, |
{ | ||
"name": "bookshelf", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "A lightweight Active Record ORM for PostgreSQL, MySQL, and SQLite3, influenced by Backbone.js", | ||
@@ -5,0 +5,0 @@ "main": "bookshelf.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
170311
4580