Class: Tartarus::ArchiveModelWithoutTenant

Inherits:
Object
  • Object
show all
Defined in:
lib/tartarus/archive_model_without_tenant.rb

Instance Method Summary collapse

Constructor Details

#initialize(registry: Tartarus.registry, repository: Tartarus::ArchivableCollectionRepository.new) ⇒ ArchiveModelWithoutTenant

Returns a new instance of ArchiveModelWithoutTenant.



5
6
7
8
# File 'lib/tartarus/archive_model_without_tenant.rb', line 5

def initialize(registry: Tartarus.registry, repository: Tartarus::ArchivableCollectionRepository.new)
  @registry = registry
  @repository = repository
end

Instance Method Details

#archive(archivable_item_name) ⇒ Object



10
11
12
13
14
15
# File 'lib/tartarus/archive_model_without_tenant.rb', line 10

def archive(archivable_item_name)
  archivable_item = registry.find_by_name(archivable_item_name)
  collection = collection_to_archive(archivable_item)
  archivable_item.remote_storage.store(collection, archivable_item.name)
  archivable_item.archive_strategy.call(collection)
end