-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
Description
Right now an intermediary join table is automatically created for each many-to-many field definition. Ideally we should try to support the use of many-to-many fields involving custom through models, which can be necessary if other fields need to be defined as part of the many-to-many relationship.
The issue with a custom through model is that it would be necessary to introspect the specified model in order to identify what is the "origin" foreign key and the "destination" foreign key. Ideally we should find a way to ensure that this is something that is explicitly defined as part of the many-to-many field definition:
class Post < Marten::Model
# Other fields...
field :tags, :many_to_many, to: Tag, through: CustomPostTags, source: :field1, target: :field2
endReactions are currently unavailable