destroying.rb revision 28042dd9ac50a328466a3dd0464b6e26a7c8796d
28042dd9ac50a328466a3dd0464b6e26a7c8796dEugen Kuksa scope :destroying, ->() { where(is_destroying: true) }
28042dd9ac50a328466a3dd0464b6e26a7c8796dEugen Kuksa scope :active, ->() { where(is_destroying: false) }
28042dd9ac50a328466a3dd0464b6e26a7c8796dEugen Kuksa # Only use `destroy_asynchronously` if you want to destroy a repository.
28042dd9ac50a328466a3dd0464b6e26a7c8796dEugen Kuksa # It prepares the deletion by setting a flag, which enables the deletion
1ec6855738a4ea917d91182d1591714dbfcb430cEugen Kuksa Rails.logger.info "Destroy #{self.class} #{self} (id: #{id})"
36ec4872a8ea62879182f57759a24eb1bc708365Eugen Kuksa raise e.class, I18n.t('repository.delete_error', oms: Settings.OMS.with_indefinite_article)
28042dd9ac50a328466a3dd0464b6e26a7c8796dEugen Kuksa raise Repository::DeleteError, I18n.t('repository.delete_error')
28042dd9ac50a328466a3dd0464b6e26a7c8796dEugen Kuksa Rails.logger.info "Mark #{self.class} #{self} (id: #{id}) as is_destroying"