dresende/node-orm2 — pull request #49 by zachberry (2013-02-23 02:41:11+00:00)
Title: hasMany association properties not being checked

(The following has been tested with the MySQL driver)

Consider the following hasMany relationship:

`Person.hasMany('things', {
price_paid: {type:'number'},
year_bought: String
});`

Now imagine `sync` is invoked on all tables. In 2.0.2 price_paid works fine, however year_bought results in a value of `undefined` being passed for the `prop` argument in `buildColumnDefinition`, and throw an error.

I poked around and I think this is due to the fact that `Property`s `check` method is not transforming the types of any `many_associations`. The attached code is a simple copy/paste job that duplicates the check code from `ORM.prototype.define` into the `Many` class.

This fix allows both of the additional properties for this association to sync correctly.

I can help if more is needed or this should be organized in a different manner.