Shopify/batman — pull request #447 by smathy (2012-05-30 20:51:03+00:00)
Title: Only set the `id` if it's defined in the JSON

Traced a bug we were having in our CouchDB app back to this issue.

CouchDB responds to `update`s with a JSON packet showing success or failure, but this **not** the document itself.

This isn't really a problem for the other fields, but without the change in this PR the `_id` field (primary key in CouchDB) is overwritten with `undefined`. I have a workaround in our adapter now, but I thought this was a worthwhile change anyway because I can't imagine why you'd want to overwrite your primary key unless the key in the JSON was defined