question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[2.0.0] `Cannot read property '_internalModel' of undefined` when saving changeset created off relationship

See original GitHub issue

Version

2.0.0

Test Case

https://ember-twiddle.com/71783e0988666e55502dfdafadc55145 The test case is basically two model instances with a one-to-one relationship. When creating a changeset like new Changeset(this.model.post), save won’t work properly on the changeset.

Steps to reproduce

Click the save button in the twiddle and the error is thrown.

Expected Behavior

Save works properly

Actual Behavior

Somehow the scope is lost when saving the changeset, thus this is undefined. The spot where it’s going wrong is this branch of the save code: https://github.com/poteto/ember-changeset/blob/d2f9cbe8d6d8f7b774fc51a39d5bdfc7c2df9fc5/addon/index.ts#L227-L235

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
snewcomercommented, Jun 15, 2020

v3.6.0!

0reactions
nickschotcommented, Feb 10, 2019

I am not 100% sure, the changeset is definitely working before fully resolving it. I think by adding it in the save method we just add support for passing a relationship and not for records that haven’t been loaded yet.

Going to dig a little more this week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ember.js - Has Many relationship undefined in computed ...
In Ember, whatever you return from the model hook of a route gets set as the model property of the associated controller.
Read more >
Bug List - Bugs - Eclipse
IllegalArgumentException: Index out of bounds, 2.0.0, M7 ... WORK, revision.get(CDOFeature) doesn't work if container property is enabled for that feature ...
Read more >
@ember-data/debug | Yarn - Package Manager
Release 2.0.0 (August 20, 2015). Breaking Changes. Unsaved deleted records are no longer removed from hasMany relationships and RecordArrays returned by the ...
Read more >
Allen SDK Documentation
revision. NWB files released prior to 6/11/2020 are not guaranteed to work with the 2.0.0 version of AllenSDK. If you cannot or choose...
Read more >
Oracle Financial Services Basel Regulatory Compliance for US
Getting Started. 1.1. Intended Audience. Welcome to Release 8.1.2.0.0 of the Oracle Financial Services Basel Regulatory Compliance. User Guide.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found