chanzuckerberg/sorbet-rails

Clarifying "Skip method ... because it is not autogenerated by Rails.

hdoan741 opened this issue · 2 comments

What does this mean when I run into "rake rails_rbi:models": Skip method ... because it is not autogenerated by Rails.

Flagged on Sorbet Slack
https://sorbet-ruby.slack.com/archives/CJL5B3CEN/p1561129789024600

This message is shown when the method is overridden. sorbet-rails tries to use the information from the database & Rails source code to infer what Rails would normally dynamically generate. If you override the method, it’s not reliable that we’ll generate correct type. Because of that, we opt to skip the method. You’d have to define sigs for the methods yourself.

I think if sorbet-rails put the auto generated method in modules instead of the class itself, it’ll be safe to generate these methods, and users would override sigs for method that the sig actually change.

I updated README to explain the error message #21