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

Commit aca6d5b8 by Sascha Depold

fixed conditions for postgresql

1 parent 281a5871
Showing with 7 additions and 4 deletions
...@@ -569,11 +569,14 @@ describe("[" + dialect.toUpperCase() + "] DAOFactory", function() { ...@@ -569,11 +569,14 @@ describe("[" + dialect.toUpperCase() + "] DAOFactory", function() {
this.User.create({ name: 'barfooz' }).success(function(user1) { this.User.create({ name: 'barfooz' }).success(function(user1) {
this.User.create({ name: 'barfooz' }).success(function(user2) { this.User.create({ name: 'barfooz' }).success(function(user2) {
this.Task.create({ title: 'task' }).success(function(task) { this.Task.create({ title: 'task' }).success(function(task) {
var where = [Sequelize.Utils.addTicks(this.User.tableName) + ".`id`=?", user1.id]
if (dialect === 'postgres') {
where = ['"' + this.User.tableName + '"."id"=?', user1.id]
}
this.User.findAll({ this.User.findAll({
where: [ where: where,
Sequelize.Utils.addTicks(this.User.tableName) + ".`id`=?",
user1.id
],
include: [ 'Task' ] include: [ 'Task' ]
}).success(function(users){ }).success(function(users){
expect(users.length).toEqual(1) expect(users.length).toEqual(1)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!