versions
raises error whenever PaperTrail::Version
is a parent to an abstract superclass
#1464
Open
3 tasks done
paper_trail
gemThis is the exact same issue demonstrated 7 years ago on StackOverflow. In short, extending from PaperTrail::Version in an abstract class and then extending that abstract class to a concrete custom version model class will raise an error whenever
#versions
is calledReproduction script
This will fail with error:
And anyone finding this via Google, this is the error you'll see in Postgres as opposed to sqlite:
Workaround
Changing
ApplicationVersion
to instead extend fromActiveRecord::Base
and includePaperTrail::VersionConcern
works, however:Another workaround would be to eliminate the grandparent and have one's custom version classes extend directly from
PaperTrail::Version
. This also works:Why did I do this to myself?
This example from the readme—ironically, about custom version class names—extends from
PaperTrail::Version
instead of including the concernSince I wanted to own a custom
ApplicationVersion
from which all my custom versions could extend, I fell into this trapThe text was updated successfully, but these errors were encountered: