Sha256: ab2d5f5677698ad55020bd1b7c7795d3b8c93a9e79ada3fb07869badefa90bd3
Contents?: true
Size: 554 Bytes
Versions: 13
Compression:
Stored size: 554 Bytes
Contents
module CouchPotato module Persistence module Revisions # returns all available revisions of a document, first to last. # causes n+1 requests. do not use in production code. def _revisions with_revs = database.couchrest_database.get(id, revs: true, revs_info: true)._document revs_info = with_revs[:_revs_info] revs = revs_info.select {|info| info[:status] == 'available' }.map {|info| info[:rev] } revs.reverse.map {|rev| database.couchrest_database.get(id, rev: rev) } end end end end
Version data entries
13 entries across 13 versions & 1 rubygems