From d828dce8f03360125c86bc4237454482d548449d Mon Sep 17 00:00:00 2001 From: Joe Ferner Date: Thu, 15 Dec 2011 16:21:53 -0500 Subject: [PATCH] more updates to readme --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4c1a893..bf69b10 100644 --- a/README.md +++ b/README.md @@ -526,6 +526,9 @@ __Example__ Includes the associated data linked by (hasMany or hasMany(through)) the propertyName when retrieving data from the database. This will replace obj.propertyName with an array of results as opposed to the default before which is a query. +Internally this will do a join to the associated table in the case of a one to many. And will do a join to the associated through table +and the associated table in the case of a many to many. + __Arguments__ * propertyName - This can be a single property name or an array of property names to include. @@ -533,7 +536,9 @@ __Arguments__ __Example__ Person.include("phones").where('name = ?', 'bob').all(connection, function(err, people) { - // all people name 'bob' and all their phone numbers + // all people named 'bob' and all their phone numbers + // so you can do... people[0].phones[0].number + // as opposed to... people[0].phones.all(function(err, phones) {}); });