Access CouchDB document revisions with RelaxDB
A nice trick to get quick access to the CouchDB document revisions with the Ruby RelaxDB library:
I messed with RelaxDB for Ruby for a little while to get this whole revisiony thing to work. For those familiar with RelaxDB, it exposes RelaxDB.load(_id, :revs=>true) for you, but due to limitations in Couch, you can’t get the :revs from a view, only directly loading an object. So to get around this, I mixed a revisions method into the Document class:
Check the other CouchDB tricks
- Paginating with CouchDB
- Generic CouchDB _changes consumer using node.js
- A Stub Ruby Library for CouchDB
- CouchDB List Functions
via: http://fapper.com/post/379058417/easy-document-revisions-with-relaxdb