geddy / model

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

Fix for always empty rule.message. #76

Closed hamsterready closed 11 years ago

hamsterready commented 11 years ago

Hi,

I am using geddy and was trying to follow geddy documentation to get custom mode properties validation messages:

  this.validatesConfirmed('password', 'confirmPassword',
                          { message : 'My custom message here....'});

however it did not work.

Not sure if attached fix is best way to do it... but it works for me :)

ben-ng commented 11 years ago

Awesome! Can we have a test for this? You'd probably want to add it in test/unit/validators.js

Let me know if you need help with this.

hamsterready commented 11 years ago

Playing with it at the moment, not sure if it works in all cases... as started getting [[model.validatesPresent]] instead of 'generic' message... btw, what is best way of testing changed in dependency to geddy?

Tried this one: http://stackoverflow.com/questions/11233133/when-installing-a-package-with-npm-can-you-tell-it-to-use-a-different-version-o?lq=1#comment25690724_11233365

Quite new to node/npm so at the moment I have installed model from my form and linked to geddy/node_modules/model... not best way of doing.

ben-ng commented 11 years ago

You can use npm link to do that. Or create a symlink from node_modules/model to wherever your clone is.

I remember seeing a test in geddy for custom error messages. The text was "Subdivisions!"

Im curious as to why that's passing now. Will check back tonight when I'm free.

ben-ng commented 11 years ago

Merged, thanks! It turned out that a typo in the tests is why we weren't detecting this problem.