Using PaperTrail, can I discard `object_changes` for a specific model or atttribute?

This is somewhat related to # 837 , as I have a large data column on my models, however I think I might be better opposite to what is offered in this release, that is, to maintain an object column, but not for an object_changes column.

We worked without the column version.object_changes. Now that I have added this column, I realized that I am writing a lot of data that I do not need for the data column in object_changes - since a tiny change in the data causes it to be automatically written out in version 3x (once in objectand twice in object_changesfor before and after) .

I don’t think that skipping or ignoring is what I want, because I really would like the data changes to create a new version.

Should I go down the user model path? Or what do you recommend?

+4
source share
1 answer

Some options in descending order of recommendations (most recommended first):

  1. version_limit(supported) - instead, save disk space by limiting the number of versions created for this record with version_limit. ( https://github.com/airblade/paper_trail#2e-limiting-the-number-of-versions-created )
  2. () - , object_changes. track_associations (track_associations false [ ])
  3. recordable_object_changes, 1 ( ) - , versions. #paper_trail RecordTrail RecordTrail#recordable_object_changes. .
  4. recordable_object_changes, 2 ( ) - RecordTrail#recordable_object_changes, . , , . .
  5. (, ) - , object_changes object. , , , .

, PR, , , , object_changes. , , . , .

, 2019: object_changes_adapter. , , , .

+3

Source: https://habr.com/ru/post/1661625/


All Articles