Module: DraftPunk::Model::DraftDiffInstanceMethods
- Defined in:
- lib/draft_diff_instance_methods.rb
Instance Method Summary collapse
-
#draft_diff(include_associations: false, parent_object_fk: nil, include_all_attributes: false, include_diff: false, diff_format: :html, recursed: false) ⇒ Hash
Return the differences between the live and draft object.
Instance Method Details
#draft_diff(include_associations: false, parent_object_fk: nil, include_all_attributes: false, include_diff: false, diff_format: :html, recursed: false) ⇒ Hash
Return the differences between the live and draft object.
If include_associations is true, it will return the diff for all child associations, recursively until it gets to the bottom of your draft tree. This only works for associations which have the approved_version_id column
15 16 17 18 |
# File 'lib/draft_diff_instance_methods.rb', line 15 def draft_diff(include_associations: false, parent_object_fk: nil, include_all_attributes: false, include_diff: false, diff_format: :html, recursed: false) draft_obj = recursed ? draft : get_draft # get_draft will create missing drafts. Based on the logic, this should only happen when you *first* call draft_diff get_object_changes(self, draft_obj, include_associations, parent_object_fk, include_all_attributes, include_diff, diff_format) end |