Skip to content

Commit

Permalink
more updates to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
joeferner committed Dec 15, 2011
1 parent 766c153 commit d828dce
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Expand Up @@ -526,14 +526,19 @@ __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.

__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) {});
});

<a name="tx"/>
Expand Down

0 comments on commit d828dce

Please sign in to comment.