简体   繁体   中英

Why is changeset for Paper Trail empty?

I recently upgraded my Ruby to 3.1.2 and Rails to 7.0.3.1.

Somewhere in the changes, one problem I noticed is that my Paper Trails (paper_trails gem) info was now not working, at least with respect to the details.

None of the "changeset" data was available, as so my tests were failing.

I put a "byebug" in the view that used the data and looked for what was missing. Apparently my "changeset" data was all missing.

Using this link:

Upgrading to Rails 6.1.6.1 causes Psych::DisallowedClass: Tried to load unspecified class: Symbol

And these:

https://github.com/paper-trail-gem/paper_trail/issues/446

https://github.com/ruby/psych/issues/490

I guessed it was a disallowed class problem, and I ultimately sat on that view breakpoint running

PaperTrail.serializer.load(change_history_by_month.object_changes) (your parameter will be different of course)

until it output the right data. The basic problem apparently was Pysch, and several disallowed classes (for example, "Psych::DisallowedClass Exception: Tried to load unspecified class: BigDecimal"), but fortunately the above will tell you the classes and you can add them to config/application.rb

Very frustrating as it was all quiet, without warnings or errors.

Of course, the classes aren't disallowed for nothing. There may be a security problem here with allowing these classes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM