不要怂,就是干,撸起袖子干!

Commit 857d76af by Mick Hansen

Merge branch 'master' of github.com:innofluence/sequelize

2 parents 077242c0 35d9221a
# v1.5.0 # # v1.5.0 #
- [REFACTORING] use underscore functions for Utils.isHash (thanks to Mick-Hansen) - [REFACTORING] use underscore functions for Utils.isHash (thanks to Mick-Hansen/innofluence)
- [REFACTORING] removed the 'failure' event and replaced it with 'error' - [REFACTORING] removed the 'failure' event and replaced it with 'error'
- [BUG] fixed booleans for sqlite (thanks to vlmonk) - [BUG] fixed booleans for sqlite (thanks to vlmonk)
- [BUG] obsolete reference attribute for many-to-many associations are removed correctly - [BUG] obsolete reference attribute for many-to-many associations are removed correctly
- [FEATURE] added possibility to set protocol and to remove port from postgresql connection uri (thanks to danielschwartz) - [FEATURE] added possibility to set protocol and to remove port from postgresql connection uri (thanks to danielschwartz)
- [FEATURE] added possibility to not use a junction table for many-to-many associations on the same table (thanks to innofluence) - [FEATURE] added possibility to not use a junction table for many-to-many associations on the same table (thanks to janmeier/innofluence)
- [FEATURE] results of the `import` method is now cached (thanks to janmeier) - [FEATURE] results of the `import` method is now cached (thanks to janmeier/innofluence)
- [FEATURE] added possibility to check if a specific object or a whole bunch of objects is currently associated with another object (thanks to janmeier) - [FEATURE] added possibility to check if a specific object or a whole bunch of objects is currently associated with another object (thanks to janmeier/innofluence)
- [FEATURE] added possibility to globally disable adding of NULL values to sql queries (thanks to janmeier) - [FEATURE] added possibility to globally disable adding of NULL values to sql queries (thanks to janmeier/innofluence)
- [FEATURE] Model.create can now also be used to specify values for mass assignment (thanks to janmeier) - [FEATURE] Model.create can now also be used to specify values for mass assignment (thanks to janmeier/innofluence)
- [FEATURE] QueryChainer will now provide the results of the added emitters in the order the emitters have been added (thanks to LaurentZuijdwijk and me ;)) - [FEATURE] QueryChainer will now provide the results of the added emitters in the order the emitters have been added (thanks to LaurentZuijdwijk and me ;))
- [FEATURE] QueryChainer can now be initialized with serial items - [FEATURE] QueryChainer can now be initialized with serial items
- [FEATURE] node 0.8 compatibility - [FEATURE] node 0.8 compatibility
......
...@@ -15,6 +15,10 @@ ...@@ -15,6 +15,10 @@
{ {
"name": "Chase Geigle", "name": "Chase Geigle",
"email": "sky@skytrife.com" "email": "sky@skytrife.com"
},
{
"name": "Jan Aagaard Meier (Innofluence)",
"email": "jam@innofluence.com"
} }
], ],
"dependencies": { "dependencies": {
......
if(typeof require === 'function') {
const buster = require("buster")
, Sequelize = require("../index")
, config = require("./config/config")
, dialects = ['sqlite', 'mysql', 'postgres']
}
buster.spec.expose()
dialects.forEach(function(dialect) {
describe('DAO@' + dialect, function() {
before(function(done) {
var self = this
this.sequelize = new Sequelize(config.database, config.username, config.password, {
logging: false
})
this.User = this.sequelize.define('User', {
username: { type: Sequelize.STRING },
secretValue: Sequelize.STRING
})
self.sequelize
.getQueryInterface()
.dropAllTables()
.success(function() {
self.User
.sync({ force: true })
.success(done)
.error(function(err) {
console.log(err)
})
})
.error(function(err) { console.log(err) })
})
describe('create with whitelist', function() {
var data = {
username: 'Peter',
secretValue: '42'
}
it('should only store the values passed in the witelist', function(done) {
var self = this;
this.User.create(data, ['username']).success(function(user) {
self.User.find(user.id).success(function(_user) {
expect(_user.username).toEqual(data.username);
expect(_user.secretValue).not.toEqual(data.secretValue);
done();
})
})
})
it('should store all values if no whitelist is specified', function(done) {
var self = this;
this.User.create(data).success(function(user) {
self.User.find(user.id).success(function(_user) {
expect(_user.username).toEqual(data.username);
expect(_user.secretValue).toEqual(data.secretValue);
done();
})
})
})
})
})
})
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!