Skip to content

deleteAll does not work for embedsMany relations #251

Closed

Description

@offlinehacker
No description provided.

Activity

  1. changed the title [-]deleteAll is not defined for embedsMany relations[/-] [+]deleteAll does not work for embedsMany relations[/+] on Aug 22, 2014
  2. offlinehacker commented on Aug 22, 2014

    @offlinehacker
    ContributorAuthor

    Current workaround:

      /* Workaround to make delete on embedsMany work */
      Exercise.prototype.__delete__resources = function (cb) {
        var self = this;
        self.resources(function(err, resources) {
          if (err) cb(err);
          resources.forEach(function(resource) {
            self.resources.destroy(resource.id, function(err) {
              if (err) cb(err);
            });
          });
          cb();
        });
      };
    
  3. jannyHou commented on Aug 12, 2016

    @jannyHou
    Contributor

    I am closing it since duplicate bug already reported here: #258

    To keep it easy to track let's keep updating fix and discussion under that one. Thanks for understanding :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions