generate_rbs_for_models errors on scopes with rest arg
grncdr opened this issue · comments
Stephen Sugden commented
Running rbs_rails:generate_rbs_for_models
with the following app/models/example.rb
fails:
class Example < ActiveRecord::Base
scope :foo, ->(*bars) { where(bar: bars) }
end
The error is unexpected: (restarg :bars)
. I can work around the crash by changing the scope to a class method, but then it will not be included in the generated .rbs file.
Version info:
bundle info rbs_rails
* rbs_rails (0.7.0)
Summary: A RBS files generator for Rails application
Homepage: https://github.com/pocke/rbs_rails
Path: <snip>/lib/ruby/gems/2.6.0/gems/rbs_rails-0.7.0
Stephen Sugden commented
I am not sure but it seems like this is the signature that needs to be updated:
rbs_rails/gem_rbs/gems/activerecord/6.0.3.2/activerecord.rbs
Lines 4 to 5 in 081b6f2