geddy/model — pull request #171 by JohnPostlethwait (2014-02-13 08:24:58+00:00)
Title: Adding a better error message when a validation name is invalid.

When you tried to add a validator on a property that was non-existent, like this:

```
var MyModel = function () {
this.validatesPresent('bad_prop');
};
```

Gedddy Model would throw this error:

```
/usr/local/lib/node_modules/geddy/node_modules/model/lib/index.js:955
reg[this.name].properties[name].validations[condition] =
^
TypeError: Cannot read property 'validations' of undefined
```

Which is not terribly helpful. When you add a validation for a non-existent property now, it will throw this error:

```
Error: Validation cannot be added for "bad_prop": property does
not exist on the MyModel model.
```

I'd be happy to write a test for this, but I had a difficult time determining where the test should go...