arangox_ecto icon indicating copy to clipboard operation
arangox_ecto copied to clipboard

Edge reference to multiple collection types

Open TomGrozev opened this issue 3 years ago • 3 comments
trafficstars

Discussed in https://github.com/TomGrozev/arangox_ecto/discussions/35

Originally posted by rxndxm January 20, 2022 @TomGrozev Hi! I'm looking to have a References edge, which can point to various Collections (for instance a Video can reference a Person or a Place) -- is this possible? I see only one Collection can be set in the _to: field:

use ArangoXEcto.Edge, from: User, to: Post

TomGrozev avatar Apr 17 '22 00:04 TomGrozev

Have attempted an approach at doing this but there are constraints in the Ecto ability to have multiple schemas assigned to an association.

Pushing to v1.2 as to not hold up v1.1. Will attempt again later.

TomGrozev avatar May 28 '22 14:05 TomGrozev

Seems like this would be quite important! Is there a suggested way of working around the limitation while the work is in-progress or is the best method just to not use the library until it was added if this was absolutely critical?

incorvia avatar Jun 14 '22 02:06 incorvia

Seems like this would be quite important! Is there a suggested way of working around the limitation while the work is in-progress or is the best method just to not use the library until it was added if this was absolutely critical?

Good news @incorvia, I recently found a way to get this working. It will be in the next version. Sorry it took a while haha

TomGrozev avatar Mar 14 '24 19:03 TomGrozev