lib/mongoid/archivable/restoration.rb in mongoid-archivable-1.6.0 vs lib/mongoid/archivable/restoration.rb in mongoid-archivable-1.7.0
- old
+ new
@@ -1,11 +1,17 @@
module Mongoid
module Archivable
module Restoration
# Restores the archived document to its former glory.
def restore
- original_document.save
+ if original_document.save
+ original_document
+ end
+ end
+
+ def restore!
+ original_document.save!
original_document
end
def original_document
@original_document ||= begin
@@ -33,6 +39,6 @@
def original_class
original_class_name.constantize
end
end
end
-end
\ No newline at end of file
+end