简体   繁体   中英

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

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!

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.

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