Closed sikanhe closed 7 years ago
After much discussion i think this is the right way to go.
There's simply too much variety in how Ecto associations work to try to re-invent all of it here. I think there is still value for a target based batching API but the name assoc
really should just use the ecto functionality.
After needing this lib for many_to_many relationship (which it dosn't support). I realized something.
Instead of doing a separate :perform_x_relation function for every type of relation, we can just use the assoc object and Repo.preload/2 to fetch the results for us. Since we know all the information we need in the association struct, and ecto already knows handles all relationship types in preload already, why not take advantage of it?