Open nishtahir opened 4 years ago
Can you please provide a minimal example how to trigger this?
@weiznich i've put together a sample demonstrating the issue here https://github.com/nishtahir/diesel-issues-2298
@nishtahir Thanks for putting together the reproducible example. I think .grouped_by
is designed to be called with the same list of elements passed to belongs_to
, so that this is just a use case we did'nt design the API for. That said it is probably useful to also support this, but I need to think about what's the right behaviour here.
Setup
Versions
Feature Flags
Problem Description
I believe the problem is with the map access here https://docs.diesel.rs/src/diesel/associations/belongs_to.rs.html#128
What are you trying to accomplish?
I'm trying to group the results by a given list of model IDs. I think that IDs that are not represented should be ignored but at the very least should not cause a panic
What is the expected output?
It should not panic
What is the actual output?
It currently panics with the backtrace provided above
Checklist