Class: PaperTrail::Events::Destroy Private

Inherits:
Base
  • Object
show all
Defined in:
lib/mongo_trails/events/destroy.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

See docs in ‘Base`.

Constant Summary

Constants inherited from Base

Base::RAILS_GTE_5_1

Instance Method Summary collapse

Methods inherited from Base

#changed_notably?, #initialize

Constructor Details

This class inherits a constructor from PaperTrail::Events::Base

Instance Method Details

#dataObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return attributes of nascent ‘Version` record.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/mongo_trails/events/destroy.rb', line 14

def data
  data = {
    item_id: @record.id,
    item_type: @record.class.base_class.name,
    event: @record.paper_trail_event || "destroy",
    whodunnit: PaperTrail.request.whodunnit
  }
  if record_object?
    data[:object] = recordable_object(false)
  end
  if record_object_changes?
    data[:object_changes] = prepare_object_changes(notable_changes)
  end
  merge_item_subtype_into(data)
  (data)
end