-
Notifications
You must be signed in to change notification settings - Fork 43
Add sigs for Rails::Engine.root
#319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hmmm, where did this come from? 🤔 https://github.com/Shopify/rbi-central/actions/runs/14894667820/job/41834680162?pr=319#step:4:46 |
I think Tapioca sees it differently because it's delegated: https://github.com/rails/rails/blob/main/railties/lib/rails/engine.rb#L436? |
|
||
class << self | ||
sig { returns(Pathname) } | ||
def root; end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this defined? I can't see any Rails::Engine.root
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's delegated https://github.com/rails/rails/blob/main/railties/lib/rails/engine.rb?#L436
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method_missing
🤮
So in combination with this delegation: https://github.com/rails/rails/blob/747f85f200e7bb2c1a31b4e26e5a5655e2dc0cdc/railties/lib/rails/engine.rb#L436
It evaluates like YourEngine.instance.config.root
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's delegated https://github.com/rails/rails/blob/main/railties/lib/rails/engine.rb?#L436
That's Rails::Engine#root
though, not the one I am asking about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method_missing
🤮
Right, but also that means all class methods are delegated to instance methods, not just root
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I didn't get that far, root
was the only sig I needed :D
No description provided.