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

Commit 12ee84fe by Mick Hansen

Merge pull request #2531 from sequelize/revert-2525-associating-sections-when-deletions

Revert "Breaking include on find when irrelevant columns in the join tab...
2 parents 0e9f5fcd 2936b8c2
Showing with 0 additions and 45 deletions
...@@ -1565,51 +1565,6 @@ describe(Support.getTestDialectTeaser("HasMany"), function() { ...@@ -1565,51 +1565,6 @@ describe(Support.getTestDialectTeaser("HasMany"), function() {
}); });
}); });
it('should correctly get associations even after a child instance is deleted', function() {
var self = this,
user, projects;
return this.sequelize.sync({logging: console.log}).then(function() {
return Promise.all([
self.User.create({name: 'Matt'}),
self.Project.create({name: 'Good Will Hunting'}),
self.Project.create({name: 'The Departed'})
]);
})
.spread(function (user, project1, project2) {
return user.addProjects([project1, project2]).return(user);
})
.then(function(user) {
return Promise.all([
user,
user.getProjects()
]);
})
.then(function(savedUser, savedProjects) {
var user = savedUser,
projects = savedProjects;
return Promise.all([
self.sequelize.query('alter table user_projects drop constraint user_projects_project_id_fkey;'),
self.sequelize.query('alter table user_projects drop constraint user_projects_user_id_fkey;')
])
})
.spread(function() {
var project = projects[0];
expect(project).to.be.defined;
return project.destroy().return(user);
})
.then(function(user) {
return self.User.find({
where: { id: user.id},
include: self.Project
});
})
.then(function(user) {
var projects = user.Projects;
var project = projects[0];
expect(project).to.be.defined;
});
});
it('should correctly get associations when doubly linked', function() { it('should correctly get associations when doubly linked', function() {
var self = this; var self = this;
return this.sequelize.sync({force: true}).then(function() { return this.sequelize.sync({force: true}).then(function() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!