flatiron/resourceful — Issue #26: `update` not returning resource `_id`
Author: pkumar
Created: 2011-12-05 00:17:03+00:00
State: open

I have the following in my couchdb

```
{
"_id": "wolf",
"_rev": "1-7714a2a782c34ab672f44c841478ec9a",
"diet": "herbivore",
"vertebrate": true,
"belly": [],
"resource": "Creature"
}
```

and if I execute this code

```
var resourceful = require('../lib/resourceful');

var Creature = resourceful.define('creature', function () {
this.use('couchdb', {database: 'flatiron'});
this.property('diet');
this.property('vertebrate', Boolean);
this.property('belly', Array);

this.prototype.feed = function (food) {
this.belly.push(food);
};
});

Creature.get('wolf', function (err, wolf) {
console.log(wolf);
wolf.update({diet: 'carnivore'}, function (err, creature) {
console.log(creature);
});
});
```

I get the following output

```
{ _id: 'wolf',
diet: 'herbivore',
vertebrate: true,
belly: [],
resource: 'Creature',
_rev: '1-7714a2a782c34ab672f44c841478ec9a' }
{ _id: undefined,
diet: 'carnivore',
vertebrate: null,
belly: [],
resource: 'Creature',
_rev: '2-16e53b06d3699c2fdaad5d8fb4ead10c' }
```