Skip to content

Commit

Permalink
Added example for customizing lox User model
Browse files Browse the repository at this point in the history
  • Loading branch information
reaktivo committed Jul 10, 2012
1 parent b08cc6d commit cfd7f5c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@ Lox also provides login and logout middleware so you can quickly add it to your
app.get "/logout", lox.routes.logout("/success_uri", "/fail_uri")


## Extending the User Model

The default User model that comes with lox only contains the `email` and `password` fields with corresponding validation and hashing features.
You can extend it via Mongoose's [plugin functionality](http://mongoosejs.com/docs/plugins.html) or by adding your own fields directly.

UserSchema = lox.User
UserSchena.add {
name: String
age: Number
}

## Version History

- 0.3.0 Allows sharing a mongoose instance when calling the lox method
Expand Down

0 comments on commit cfd7f5c

Please sign in to comment.