Remove CouchRest.move, CouchRest::Database#move and #move_doc, because these methods are no longer supported by CouchDB

Ref: http://n2.nabble.com/Removing-MOVE-td2490780.html#a2490780
This commit is contained in:
Geoff Buesing 2009-03-18 11:22:49 -05:00
parent 76ef427862
commit 4d8314124b
4 changed files with 0 additions and 113 deletions

View file

@ -224,26 +224,6 @@ module CouchRest
copy_doc(doc, dest)
end
# MOVE an existing document to a new id. If the destination id currently exists, a rev must be provided.
# <tt>dest</tt> can take one of two forms if overwriting: "id_to_overwrite?rev=revision" or the actual doc
# hash with a '_rev' key
def move_doc(doc, dest)
raise ArgumentError, "_id and _rev are required for moving" unless doc['_id'] && doc['_rev']
slug = escape_docid(doc['_id'])
destination = if dest.respond_to?(:has_key?) && dest['_id'] && dest['_rev']
"#{dest['_id']}?rev=#{dest['_rev']}"
else
dest
end
CouchRest.move "#{@uri}/#{slug}?rev=#{doc['_rev']}", destination
end
### DEPRECATION NOTICE
def move(doc, dest)
puts "CouchRest::Database's move method is being deprecated, please use move_doc instead"
move_doc(doc, dest)
end
# Compact the database, removing old document revisions and optimizing space use.
def compact!
CouchRest.post "#{@uri}/_compact"