add move and copy support to CouchRest::Document instances
This commit is contained in:
parent
0519fc5765
commit
a0a422b779
2 changed files with 95 additions and 0 deletions
|
@ -56,6 +56,18 @@ module CouchRest
|
|||
end
|
||||
result['ok']
|
||||
end
|
||||
|
||||
def copy(dest)
|
||||
raise ArgumentError, "doc.database required to copy" unless database
|
||||
result = database.copy(self, dest)
|
||||
result['ok']
|
||||
end
|
||||
|
||||
def move(dest)
|
||||
raise ArgumentError, "doc.database required to copy" unless database
|
||||
result = database.move(self, dest)
|
||||
result['ok']
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue