Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize through associations #165

Open
chrisandreae opened this issue Jun 4, 2021 · 0 comments
Open

Generalize through associations #165

chrisandreae opened this issue Jun 4, 2021 · 0 comments

Comments

@chrisandreae
Copy link
Member

Currently, through: association are implemented with the assumption that they're for use with many-to-many associations, which don't make sense at all to be owned. Because of that, a through: association to a non-root isn't supported. This is a bit over-strict, since there are other valid cases to have an association use a hidden join table, such as an ordered polymorphic collection.

Achieving this will require a hefty refactor of UpdateOperation#build_updates_for_collection_referenced_association to generalize it to work for both referenced and nested targets.

An additional feature that we may want to consider supporting should we refactor this is to support polymorphic associations where the targets may be either (referenced) root types or (nested) owned types. This would allow us to better represent the common vs custom text associations as a single polymorphic association.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant