There is an alternative way to do it:
class Version < PaperTrail::Version
...
def user
User.find(whodunnit) if whodunnit
end
end
If you need to add user model to the PaperTrail::Version
class itself, then add a new initializer to your app:
config/initializers/papertrail_monkey_patch.rb
module PaperTrail
class Version
def user
User.find(whodunnit) if whodunnit
end
end
end