lolmaus / ember-cli-stained-by-children

Ember CLI addon: a mixin that makes the `isDirty` property of a record respect the dirtiness of its belongsTo/hasMany children
MIT License
25 stars 6 forks source link

CleanEmbeddedChildrenMixin propagate reload #13

Closed jakesjews closed 8 years ago

jakesjews commented 9 years ago

Propagate the fact that child records were reloaded from the server when a parent record call reload.

For some reason running ember test hangs after the tests run but I noticed that updating to ember-cli 1.13.7 fixes the issue.

lolmaus commented 9 years ago

Hey @jakesjews, thank you for your contribution and especially for the test case.

Due to working in an Angular project, I've been neglecting to keep this addon up to date for quite a while. I'm surprised that the addon works for you in 1.13.x.

I've just changed jobs and the new one is dedicated to Ember, so I'm planning to catch up. I'll accept your and others' PRs and release a new version, hopefully in a couple of weeks.

Meanwhile, please use your own fork (you can link to git branches for package.json).

jakesjews commented 9 years ago

@lolmaus thanks, the addon has still been working well for us on ember-1.13 although we are still on ember-data beta-18 due to some other unrelated issues.

lolmaus commented 9 years ago

Ah, well, then subj is one of those issues. Sorry. :) I promise to catch up.

lolmaus commented 9 years ago

So I officially give up on this. Sorry.

Unlike an attribute, a relationship in Ember Data is always initialized empty, and then it gets populated. Even if a relationship appears prefilled with a payload, there will still be a brief moment when the relationship is empty. This defeats the possibility to use observers/CPs on the relationship.

If someone tells me how to distinguish a prefilled relationship from both an empty relationship or a relationship that was originally empty and was later filled, then I'll release an up to date version of this addon.