leaguevine / leaguevine-ultistats

MIT License
18 stars 4 forks source link

Try to use model_id: instead of model: {id: } where possible. #53

Closed cboulay closed 12 years ago

cboulay commented 12 years ago

In many of the associations, a model refers to its associates both through associate_id and the associate object itself. e.g. game has both .season and .season_id

If there are cases where we need the _id and nothing else, it would be better to use that instead, and tell the API requests to ignore the full version of the associated resource to hopefully speed up the request.

mliu7 commented 12 years ago

Correct. Any time there is an associate object, we will also provide the "_id" attribute of the associate object.

The requests will indeed be noticeably faster if you specify only the fields that are needed, and not specify the related object fields.

cboulay commented 12 years ago

This is mostly done. I might need to tweak things a little after further testing but for now I consider this closed.