Comparing version 0.7.1 to 0.7.2
@@ -1,2 +0,2 @@ | ||
// Bookshelf.js 0.7.1 | ||
// Bookshelf.js 0.7.2 | ||
// --------------- | ||
@@ -18,3 +18,3 @@ | ||
var bookshelf = { | ||
VERSION: '0.7.1' | ||
VERSION: '0.7.2' | ||
}; | ||
@@ -42,3 +42,3 @@ | ||
console.warn('Initializing Bookshelf with a config object is deprecated, please pass an initialized knex.js instance.'); | ||
knex = new require('knex')(knex); | ||
knex = require('knex')(knex); | ||
} | ||
@@ -45,0 +45,0 @@ |
@@ -139,3 +139,3 @@ // Model | ||
.then(function() { | ||
return [this.format(this.attributes)]; | ||
return [this.format(_.extend(Object.create(null), this.attributes))]; | ||
}) | ||
@@ -142,0 +142,0 @@ .then(function(response) { |
@@ -268,3 +268,3 @@ // Relation | ||
} else { | ||
var formatted = model.format(model.attributes); | ||
var formatted = model.format(_.extend(Object.create(null), model.attributes)); | ||
groupedKey = this.isThrough() ? formatted[this.key('throughForeignKey')] : formatted[this.key('foreignKey')]; | ||
@@ -271,0 +271,0 @@ } |
{ | ||
"name": "bookshelf", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"description": "A lightweight ORM for PostgreSQL, MySQL, and SQLite3", | ||
@@ -5,0 +5,0 @@ "main": "bookshelf.js", |
@@ -225,3 +225,3 @@ var _ = require('lodash'); | ||
var M = Backbone.Model.extend({ | ||
var M = bookshelf.Model.extend({ | ||
tableName: 'test', | ||
@@ -247,2 +247,15 @@ format: function(attrs) { | ||
it('does not mutate attributes on format', function() { | ||
var M = bookshelf.Model.extend({ | ||
tableName: 'sites', | ||
format: function(attrs) { | ||
assert.ok(attrs !== this.attributes); | ||
return attrs; | ||
} | ||
}); | ||
return M.forge({id: 1}).fetch().call('load'); | ||
}); | ||
}); | ||
@@ -249,0 +262,0 @@ |
Sorry, the diff of this file is too big to display
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
1149980
31187
20