Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fix replication with couchdb 1.1.0.

couchdb 1.1.0 has a bug where it will error out
if /_replicate is passed a doc_ids with a null
value. This patch works around that bug by
not including a null doc_ids in the first place.
  • Loading branch information...
commit 40e73141c6dc79c4584b49d1b50a2d4e526c9062 1 parent 7f5f1ae
@erickt erickt authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/couchrest/database.rb
3  lib/couchrest/database.rb
@@ -341,6 +341,7 @@ def delete_attachment(doc, name, force=false)
def replicate(other_db, continuous, options)
raise ArgumentError, "must provide a CouchReset::Database" unless other_db.kind_of?(CouchRest::Database)
raise ArgumentError, "must provide a target or source option" unless (options.key?(:target) || options.key?(:source))
+ doc_ids = options.delete(:doc_ids)
payload = options
if options.has_key?(:target)
payload['source'] = other_db.root
@@ -348,7 +349,7 @@ def replicate(other_db, continuous, options)
payload['target'] = other_db.root
payload['continuous'] = continuous
- payload['doc_ids'] = options[:doc_ids] if options[:doc_ids]
+ payload['doc_ids'] = doc_ids if doc_ids "#{@host}/_replicate", payload
Please sign in to comment.
Something went wrong with that request. Please try again.