Skip to content

scope.destroyAll does not remove "through" records #95

Description

@bajtos

Consider the following test in test/relations.test.js, describe("hasAndBelongsToMany"):

    it('should destroy all related instances', function(done) {
      Article.findOne(function (e, article) {
        article.tags.destroyAll(function(err) {
          if (err) return done(err);

          article.tags(true, function(err, list) {
            if (err) return done(err);
            list.should.have.length(0);
          });
        });
      });
    });

// result
// AssertionError: expected [ null ] to have a length of 0 but got 1

/to @raymondfeng

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions