Yash Shah
Yash Shah

Reputation: 141

Integrating sorbet with paper-trail

When I try and add a has_paper_trail on any of my models to include versioning for objects created, Sorbet throws the following error:

app/models/model_name.rb:22: Method `has_paper_trail` does not exist on `T.class_of(<ModelName>)` https://srb.help/7003
    22 |  has_paper_trail

How do I fix this?

Upvotes: 1

Views: 264

Answers (1)

diraulo
diraulo

Reputation: 31

I recently ran into the same issue. We're currently using the tapioca gem to generate RBI files on our project.

In order to resolve this I added require 'paper_trail/frameworks/active_record' to sorbet/tapioca/require.rb file and ran bin/tapioca gem paper_trail to regenerate the RBI file for the paper_trail gem.

Hope this helps.

Upvotes: 3

Related Questions