Comparing version 0.1.3 to 0.1.4
@@ -1,2 +0,2 @@ | ||
// Bookshelf.js 0.1.3 | ||
// Bookshelf.js 0.1.4 | ||
@@ -28,11 +28,7 @@ // (c) 2013 Tim Griesser | ||
// Keep in sync with `package.json`. | ||
Bookshelf.VERSION = '0.1.3'; | ||
Bookshelf.VERSION = '0.1.4'; | ||
// We're using `Backbone.Events` rather than `EventEmitter`, | ||
// for consistency and portability, adding a few | ||
// functions to make the API feel a bit more like Node. | ||
// for consistency and portability. | ||
var Events = Bookshelf.Events = Backbone.Events; | ||
Events.emit = function() { this.trigger.apply(this, arguments); }; | ||
Events.emitThen = function() { return this.triggerThen.apply(this, arguments); }; | ||
Events.removeAllListeners = function(event) { this.off(event, null, null); }; | ||
@@ -299,3 +295,3 @@ // `Bookshelf` may be used as a top-level pub-sub bus. | ||
if (method === 'insert' && resp) { | ||
model[model.idAttribute] = resp[0]; | ||
model.attributes[model.idAttribute] = model[model.idAttribute] = resp[0]; | ||
} | ||
@@ -302,0 +298,0 @@ model.trigger((method === 'insert' ? 'created' : 'updated'), model, resp, options); |
{ | ||
"name": "bookshelf", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "A lightweight ORM for Postgres, MySQL, and SQLite3 with some Backbone", | ||
@@ -5,0 +5,0 @@ "main": "bookshelf.js", |
@@ -253,3 +253,4 @@ /*global describe, it */ | ||
it('saves an new object', function(ok) { | ||
new Site({name: 'Third Site'}).save().then(function() { | ||
new Site({name: 'Third Site'}).save().then(function(m) { | ||
equal(m.get('id'), 3); | ||
return new Bookshelf.Collection(null, {model: Site}).fetch(); | ||
@@ -262,3 +263,3 @@ }) | ||
ok(); | ||
}); | ||
}).then(null, ok); | ||
}); | ||
@@ -265,0 +266,0 @@ |
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
137199
3668