Module: Rubydora::Repository::SoftDeleteBehavior

Extended by:
ActiveSupport::Concern
Included in:
Rubydora::Repository
Defined in:
lib/generators/curate/soft_delete/active_fedora_soft_delete_monkey_patch.rb

Overview

There is likely a better way of doing this, but the ActiveFedora API doesn’t appear to support soft-deletes (i.e. changing the state to ‘D’)

So I am intercepting the :purge_object, :purge_datastream, and :purge_relationship methods and instead of purging, I’m modifying. the state.

Instance Method Summary collapse

Instance Method Details

#purge_datastream(*args) ⇒ Object



44
45
46
# File 'lib/generators/curate/soft_delete/active_fedora_soft_delete_monkey_patch.rb', line 44

def purge_datastream(*args)
  super(*args) rescue PerformedSoftDelete; true
end

#purge_object(*args) ⇒ Object



41
42
43
# File 'lib/generators/curate/soft_delete/active_fedora_soft_delete_monkey_patch.rb', line 41

def purge_object(*args)
  super(*args) rescue PerformedSoftDelete; true
end

#purge_relationship(*args) ⇒ Object



47
48
49
# File 'lib/generators/curate/soft_delete/active_fedora_soft_delete_monkey_patch.rb', line 47

def purge_relationship(*args)
  super(*args) rescue PerformedSoftDelete; true
end