Allow for resource to be nil when broadcasting a collection#14
Allow for resource to be nil when broadcasting a collection#14adampal wants to merge 1 commit intoleastbad:stream_updatesfrom
Conversation
* If you have a `has_many optional: true` relationship the resource may not exist. Prior to this change, the broadcast for all resources would fail if any of them were optional and didn't exist on the parent.
ba4886e to
0d05d89
Compare
|
@adampal I'm having a bit of a hard time grokking what you mean, given that I don't know a With my latest refactoring the implementation has changed a bit, and I want to help. I've put up a test case here: but can't get it to fail. Could you take a look at this? Thanks 🙏 |
|
@julianrubisch sorry, that was a typo in my PR. It should have said |
|
That would be awesome, thanks! Sorry for the inconvenience, I think it makes sense to have that properly backed by a test. |
|
@adampal are you on Discord? If not, please consider joining the discussion about this PR. https://discord.gg/stimulus-reflex |
|
@julianrubisch I commented on your PR with a "fix" to make it fail :) |
|
Thanks all! Fixed in #16 |
|
Great work, team. Thanks for the contribution, @adampal! |
|
Thanks everyone. Glad we got it resolved so easily! |
has_many optional: truerelationship the resourcemay not exist. Prior to this change, the broadcast for all resources
would fail if any of them were optional and didn't exist on the
parent.