maritz/nohm — Issue #40: unable to save data, or use logger in save call
Author: nicholasf
Created: 2012-01-05 03:28:26+00:00
State: open

Hi,

I'm setting up Nohm at the moment, and I'm finding that a call to model.save() swallows all logging output, and doesn't seem to execute. It's probably a mistake on my part, as I'm in the early stages of learning Node, but I've worked through your documentation (and the github examples) several times.

This is my model:

```
Look = nohm.model 'Look',
properties:
name:
type: 'string'
```

This is my nohm config:

```
nohm = require('nohm').Nohm
winston = require 'winston'

exports.setup = (client) ->
nohm.setPrefix 'etuii'
nohm.setClient client

nohm.logError = (err) ->
if err
winston.error err
console.trace()
nohm
```

This is my test to save the model:
```
it "creates a model", ->
look = nohm.factory('Look')
look.p({'name': "test1"})

look.save (e) ->
console.log "...."
if e
look.errors
winston.error e
console.log "error: ", e.toString(), look.errors
else
console.log ">>>"
winston.info look.id, " <<<<<<<"
should.exist look.id
```

etc ...

No logging occurs in the save call. Nor is the object written to redis.

Can you see anything obvious about what I might be doing wrong or should it be working?

Cheers,
Nicholas