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

.getAsync .hasMany #515

Open
hippich opened this issue Jan 30, 2015 · 1 comment
Open

.getAsync .hasMany #515

hippich opened this issue Jan 30, 2015 · 1 comment
Labels

Comments

@hippich
Copy link

hippich commented Jan 30, 2015

I am having schema where multiple children might have multiple parents. I actually found correct example in test:

Shop1.customers = ['customer-1', 'customer-2']
Shop2.customers = ['customer-1', 'customer-3']

As you can see 'customer-1' is member of both Shop1 and Shop2

Problem is - if I don't define reverse relation for Customer in Shop, and do not tell Customer to save parent id, it never adds Customer model into Shop's collection, despite Shop model having necessary IDs of children and making all necessary requests. From reading code it seems like expected child model to add itself into parent collection.

Few questions:

  • are my observation correct?
  • is there particular reason for this design?
  • should I implement this change and submit PR or someone else already working on fixing that?
@hippich
Copy link
Author

hippich commented Jan 31, 2015

To get better idea what I am talking about, here is small jsfiddle to illustrate problem: http://jsfiddle.net/v13e8kua/1/

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

No branches or pull requests

2 participants