daleharvey/pouchdb — pull request #702 by neojski (2013-04-18 11:41:24+00:00)
Title: 683 get attachment wrong

This code fixes #683 but besides contains small redesign:

1. getAttachment is implemented in generic adapter using get
2. _getAttachment in local adapters is just a helper function of get so we don't have to worry if we got txn in opts or not because we get it always. What's more _getAttachment no longer has to check document metadata for document because it gets this stuff from get

What needs thorough review is part I changed in ajax.js. The reason for that change is that it need to return error if it happened even if we say `options.binary`.