Skip to content

using morphMany or other ways of representing a many to many relationship #22

@ononotofu

Description

@ononotofu

hi there ! i am trying to adapt the endpoints example to work with something similar to Books having many Tags but Tags not being unique to a specific book (because there might also be Magazines and other Books that share the Tag). would this always require joining with a through table? what if I also want to have Magazines associated with the same Tags collection -- would that require a second table to join?

https://gist.github.com/ononotofu/cb268fd3c5d8b37da376 has some related implementation. is a polymorphic association appropriate without a "Books_Tags" table -- and i'd prefer to not have many similarly named joining tables created to create the relationship. it seems like there is probably a best practice for something that comes up this often, but i can't find the same relationship mocked up in an example in either bookshelf or endpoints. appreciate any help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions