balderdashy/waterline-docs — pull request #10 by darth-cheney (2014-05-12 23:12:07+00:00)
Title: Added Existing DB/Table/Field Examples

Hi.

I've gone ahead and added examples for working with existing database tables and fields to both `models.md` and `associations.md`.

In the latter, I was only able to add to the One-to-One relationship, because I'm still not quite sure how to properly structure models in a One-to-Many or Many-to-Many when the table names and fields are already defined (and especially when their structure cannot be altered).

I see you've already put a section at the bottom for documenting the Many-to-Many relationships that make use of existing `join` tables, which I assume involves making a third model between the two (that would then not have a controller). I'm willing to help with that part of the documentation once I'm clear on all the options. Diving into the code blind, I haven't been able to figure it out on my own.

What are all of the attribute options that are relevant to relationships? So far, I've discovered `via`, `on`, `references`, and `through`, but I'm not clear which of these are deprecated (if any) or what they do. If you point me to the right source file or give me a quick summary I can whip up some examples and add it to the docs.

Let me know what you think man.