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

Potential orm bug #14

Open
samselikoff opened this issue Jun 22, 2019 · 0 comments
Open

Potential orm bug #14

samselikoff opened this issue Jun 22, 2019 · 0 comments
Labels
Bug Something isn't working

Comments

@samselikoff
Copy link
Contributor

I think there's an orm bug...

// post
import DS from 'ember-data';

export default DS.Model.extend({

  author: DS.belongsTo(),

  owner: DS.belongsTo('ownerable', { polymorphic: true, inverse: null })

});


// author
Model.extend({
  
  post: belongsTo()
  
});

// scenario
let post = this.server.create('post', {
  owner: this.server.create('author')
});

author should get set as the post's owner, but ends up getting set as post's author. (The owner relationship has a null inverse, but I believe when author is being saved it looks to see if there's an inverse for model type post, says yes there is, then updates everything.)

@samselikoff samselikoff added the Bug Something isn't working label Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant