Skip to content

Instantly share code, notes, and snippets.

@olivernn olivernn/user.js
Created Dec 1, 2010

Embed
What would you like to do?
User with validation on presence of name
var User = Model('user', {
// class methods
validates: {
presenceOf: ['name']
}
}, {
// instance methods
})
o = new User ({name: "oliver"})
u.valid() -> true
b = new User ()
b.valid() -> false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.