How to generate sorbet.rbi files for new added Models in Ruby?

Viewed 1661

I've created a new model Attachment.rb and run

srb tc

But sorbet is throwing error because the Method doesn't exist for the Attachment model https://srb.help/7003

I tried running srb rbi update but turns out it re-runs my whole application.

I've searched and read through all the docs but I couldn't find anything on how to generate the RBI files just for the model. Thanks in advance!

2 Answers

If you are using zsh try escaping the [ ] :

bundle exec rake rails_rbi:models\[Attachment\]

Are you using sorbet-rails? You can run bundle exec rake rails_rbi:models[Attachment] to regenerate RBI for just that model.

Related