lib/mongoid/paranoia.rb
# Restores a previously soft-deleted document. Handles this by removing the
# deleted_at flag.
#
# @example Restore the document from deleted state.
#   document.restore
#
# For resoring associated documents use :recursive => true
# @example Restore the associated documents from deleted state.
#   document.restore(:recursive => true)
#
# TODO: @return [ Time ] The time the document had been deleted.
#
# @since 1.0.0
Restores a previously soft-deleted document. Handles this by removing the
deleted_at flag.
Restores a previously soft - deleted document . Handles this by removing the deleted_at flag .
def restore(opts = {})
      run_callbacks(:restore) do
        _paranoia_update("$unset" => { paranoid_field => true })
        attributes.delete("deleted_at")
        @destroyed = false
        restore_relations if opts[:recursive]
        true
      end
    end
def restore ( opts = { } ) run_callbacks ( :restore ) do _paranoia_update ( "$unset" => { paranoid_field => true } ) attributes . delete ( "deleted_at" ) @destroyed = false restore_relations if opts [ :recursive ] true end end
Restores a previously soft-deleted document.
Restores a previously soft - deleted document .
opts
<not_specific>
example
Restore the document from deleted state. document.restore For resoring associated documents use :recursive => true
Restore the document from deleted state . document . restore For resoring associated documents use : recursive = > true
example
Restore the associated documents from deleted state. document.restore(:recursive => true) TODO: @return [ Time ] The time the document had been deleted.
Restore the associated documents from deleted state . document . restore ( : recursive = > true ) TODO : @return [ Time ] The time the document had been deleted .
since
None