Skip to content

Commit

Permalink
Minor Document#undelete! improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurii Rashkovskii committed May 4, 2008
1 parent e88d174 commit 18b624b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/strokedb/document/delete.rb
Expand Up @@ -11,7 +11,7 @@ class DocumentDeletionError < StandardError
def undelete!
deleted_version = versions.previous
store.save_as_head!(deleted_version)
self.class.find(uuid)
store.find(uuid)
end
end

Expand Down
7 changes: 3 additions & 4 deletions spec/lib/strokedb/document/document_spec.rb
Expand Up @@ -474,10 +474,9 @@
end

it "should be undeletable" do
@document = @document.undelete!
@document.should_not be_a_kind_of(DeletedDocument)
@document.should be_mutable
@store.find(@document.uuid).should == @document
undeleted_document = @document.undelete!
@document.should_not be_mutable
undeleted_document.should_not be_a_kind_of(DeletedDocument)
end


Expand Down

0 comments on commit 18b624b

Please sign in to comment.