geddy / model

Datastore-agnostic ORM in JavaScript
265 stars 55 forks source link

Adding a clearer error message when trying to use an invalid includes. #172

Closed JohnPostlethwait closed 10 years ago

JohnPostlethwait commented 10 years ago

Before the error was this:

TypeError: Cannot read property 'model' of undefined at utils.mixin._createSelectStatement

Now it is this:

Error: Could not find the associated model "BadAssociation" on the "GoodModel" model. at utils.mixin._createSelectStatement

Test added as well.

JohnPostlethwait commented 10 years ago

As you can probably tell by all my pull requests; I keep doing things incorrectly! :tongue:

mde commented 10 years ago

This is great, thanks!