-
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
generate_rbs_for_model doesn't create sig/*/main.rbs #66
Comments
RBS Rails isn't responsible for abstract classes. If you need RBS for them, you can write the RBSs by hand or generate them with
Currently RBS Rails haven't supported ActiveStorage yet. And the priority is not high. By the way,
What is |
By the way, I think we need more documentation to introduce RBS Rails and Steep. I'll work on it. #68 |
I'm running into very similar errors when trying to introduce RBS to my Rails app:
I think rbs_rails should definitely create a signature file for ApplicationRecord at the very least, since that's something every Rails app will have. I'd definitely like better docs for how to set this up :) Thank you for your work, @pocke! |
@connorshea Thanks for your feedback! I think it needs to generate all superclasses of ActiveRecord models, including ApplicationRecord. # Ruby files
class User < ApplicationRecord
end
class Article < AnotherApplicationRecord
end
# RBS files
class ApplicationRecord < ActiveRecord::Base
end
class AnotherApplicationRecord < ActiveRecord::Base
end
class User < ApplicationRecord
end
class Article < AnotherApplicationRecord
end I'll implement it with #77 because #77 also needs to generate superclasses. By the way, I guess you need to require some library, such as And I haven't generated ActiveStorage's RBS yet, so you need to write the RBS by hand for now 🙏. |
Using:
It looks like the
generate_rbs_for_model
task doesn't generate the main.rbs file.Adding the following file fixes the error This issue extends to other generated definitions.
https://github.com/pocke/rbs_rails/blob/master/test/app/sig/main.rbs
sig/app/models/active_storage/main.rbs:
sig/app/models/acts_as_taggable_on/main.rbs:
The text was updated successfully, but these errors were encountered: