Skip to content
This repository has been archived by the owner on Oct 15, 2021. It is now read-only.

clean-embedded-children does not work with 1.0.0-beta.19.1 #10

Open
dadamssg opened this issue Jun 18, 2015 · 1 comment
Open

clean-embedded-children does not work with 1.0.0-beta.19.1 #10

dadamssg opened this issue Jun 18, 2015 · 1 comment

Comments

@dadamssg
Copy link

During the _processChildren function call, child does not have a send function.

    _processChildren: function(callback) {
      this._processRelationshipsOneOrMany(function(child) {
        if ((child == null) || !child.get('isDirty')) {
          return;
        }

        child.send('willCommit'); // <-- problem here
        callback(child);
        child.send('didCommit');

        if (typeof child._cleanChildren === "function") {
          child._cleanChildren();
        }
      });
    },

I get the following stack trace

TypeError: child.send is not a function
    at clean-embedded-children.js:61
    at clean-embedded-children.js:26
    at exports.default._emberMetalMixin.Mixin.create.forEach (ember.debug.js:32996)
    at null.<anonymous> (clean-embedded-children.js:25)
    at clean-embedded-children.js:10
    at ext.js:492
    at Map.forEach.cb (ember.debug.js:16792)
    at OrderedSet.forEach (ember.debug.js:16575)
    at Map.forEach (ember.debug.js:16796)
    at Function.ember$data$lib$system$model$$default.reopenClass.eachRelationship (ext.js:491)
@melindaweathers
Copy link

I am seeing a similar problem in beta 19.2 -- there is no error happening, but the child record is still 'isDirty' after it is processed, so clean-embedded-children just silently doesn't work.

The state of the child winds up as "root.loaded.updated.uncommitted"

EDIT: I found a hack to work around this, and it's really a separate issue, so I'll open a separate issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants