-
Notifications
You must be signed in to change notification settings - Fork 265
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
Stumped on save behavior using belongsTo #48
Comments
@brancusi I'll try to take a look this week. Thanks for all the context! |
I also had this issue and taking out the For #2, I think that you can just do |
I'm having the exact same problem, with the exact same "fix." I'm new to the library as of today (coming from Fireplace), but I imagine this has to be a relatively new bug (assuming that's what it is), given that this is a pretty common scenario that wouldn't have gone unnoticed all the way to a 1.x.x release. It took me all of an hour to run into it. Let me know if I can help try out different scenarios. |
I should ask, is it more idiomatic to set the |
The problem is in ember-data's JSONSerializer here. The only types of relationships that it serializes (1.0.0-beta7) are |
According to the notes on the commit for this method, it was the intention of the developers that you would have to override it if you needed to save the ids on the hasMany side. We're not the first to be surprised. It looks like emberfire will have to override this method. |
@neverfox nice find! Thank you! |
You're welcome. I was in a bind myself, so I needed it to work. Hopefully, the pull request I submitted is acceptable. |
I hope so too. |
Works thank you! |
I am trying to create a simple relationship between items, units, and conversions. For some reason, when I create the reverse, "belongsTo" on the model, it doesn't save the references.
So I am trying to create a relationship as follows:
Conversion Model
For some reason if I put the reverse "belongsTo" on the Conversion model, it won't save to the conversions array. If I remove it, it works. Results are below.
Unit Model
Item Model
Item Index Controller
Firebase - Without belongsTo refs on the Conversion model
Firebase - WITH belongsTo refs on the Conversion model
Questions
Promise.cast(item.get('conversions'))
The text was updated successfully, but these errors were encountered: