Class: Protege::ArchivesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Protege::ArchivesController
- Includes:
- PersonaScoped
- Defined in:
- app/controllers/protege/archives_controller.rb
Overview
Archives and unarchives a persona — the reversible, data-preserving alternative to permanent deletion.
Archiving is modeled as an archive resource on the persona: create archives it (stamps
archived_at), destroy unarchives it (clears it). An archived persona stops receiving mail and
running scheduled responsibilities, but all its history is kept and it can be restored at any time.
Both actions re-render the persona's action bar in place over Turbo (the sidebar row updates
separately via BroadcastablePersona), falling back to a full redirect for non-Turbo requests.
Instance Method Summary collapse
-
#create ⇒ void
Archive the persona.
-
#destroy ⇒ void
Unarchive the persona.
Instance Method Details
#create ⇒ void
This method returns an undefined value.
Archive the persona. Serves POST /personas/:persona_id/archive.
18 19 20 21 22 |
# File 'app/controllers/protege/archives_controller.rb', line 18 def create @persona.archive! respond_with_persona(notice: 'Persona archived — it no longer receives mail or runs scheduled tasks.') end |
#destroy ⇒ void
This method returns an undefined value.
Unarchive the persona. Serves DELETE /personas/:persona_id/archive.
27 28 29 30 31 |
# File 'app/controllers/protege/archives_controller.rb', line 27 def destroy @persona.unarchive! respond_with_persona(notice: 'Persona restored.') end |