Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store patch assumes relationships are kind of hasMany and has links #3

Open
matthewvalimaki opened this issue Nov 21, 2016 · 5 comments

Comments

@matthewvalimaki
Copy link

I am getting You tried to get the 'testCase' relationship on a 'execution' via record.hasMany('testCase'), but the relationship is of type 'belongsTo'. Use record.belongsTo('testCase') instead with

...,
relationships: {
   "test-case": {
      id: 5,
      type: "test-case"
   }
}

and this seems to be caused by

pushed.hasMany(name).__update_links(links);
. If I comment out this line error goes away and things work. It actually does two assumptions:

  1. there are links (which it doesn't)
  2. it is hasMany and not belongsTo
@matthewvalimaki matthewvalimaki changed the title Store patch assumes hasMany Store patch assumes relationships are kind of hasMany and has links Nov 21, 2016
@pangratz
Copy link
Owner

pangratz commented Nov 23, 2016

Yep, as pointed out in the README this is currently not implemented 😔 .

@matthewvalimaki
Copy link
Author

@pangratz oops! Apologies for now spotting that! The README does clearly state under "links for relationship references" that "belongs to" is not yet implemented. I'll try to figure out a PR for it as I already looked into it.

@matthewvalimaki
Copy link
Author

I am still going to work on this. Had to work on something else first.

@matthewvalimaki
Copy link
Author

matthewvalimaki commented Dec 20, 2016

Similar issue with DELETE which causes didSaveRecord to be called and it makes a reference to data.meta, which with response 204 does not exist. I'll work on this as well.

UPDATE: forgot that I already logged #2 for this.

@matthewvalimaki
Copy link
Author

@pangratz hey do you have time to take a look at PR #5? What I would like to do is start completing the other missing features of this addon, keep it up-to-date etc. I would like to avoid doing a brand new release of it.

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

No branches or pull requests

2 participants