balderdashy / waterline-docs

WARNING: The content in this repo is out of date! See https://github.com/balderdashy/sails-docs for the most up-to-date documentation
452 stars 161 forks source link

"Many-to-Many Associations" vs. "Many-to-Many Through Associations" #49

Open HerrZatacke opened 9 years ago

HerrZatacke commented 9 years ago

I think it's unclear how Many-to-Many Associations differentiates from Many-to-Many Through Associations

... Many-to-Many Associations Waterline will look at your models and if it finds that two models both have collection attributes that point to each other, it will automatically build up a join table for you. ...

... Many-to-Many Through Associations Many-to-Many through associations behave the same way as many-to-many associations with the exception of the join table being automatically created for you. This allows you to attach additional attributes onto the relationship inside of the join table. ...

What i need is "additional attributes onto the relationship inside of the join table" as described in the "Through Associations". Yet both parts f the documentation are saying the join table is created automatically. Although I guess "Through Associations" is trying to say something like

... with the exception of the join table NOT being automatically created for you...

Apart from the "coming soon" in the documentation, is this feature already implemented, and the documentation is "coming soon", or does "coming soon" refer to the feature itself?

dmarcelino commented 9 years ago

Apart from the "coming soon" in the documentation, is this feature already implemented, and the documentation is "coming soon", or does "coming soon" refer to the feature itself?

@HerrZatacke, through associations are not yet officially supported, they are coming on 0.11. Take a look at balderdashy/waterline#705.

dcolley commented 8 years ago

An example to use would be https://docs.djangoproject.com/en/1.8/topics/db/models/#extra-fields-on-many-to-many-relationships where the many-to-many / through model can also have additional attributes.

dv336699 commented 8 years ago

@dmarcelino version 0.11 is out, but I think this was pushed for a future release? thanks

edit it's out https://github.com/balderdashy/waterline/blob/2511f31d696fd6f074407a090537b5554c335d30/test/unit/query/associations/manyToManyThrough.js