Repository navigation
Add sigs for Rails::Engine.root - #319
amomchilov wants to merge 2 commits into
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.
Where is this defined? I can't see any Rails::Engine.root method.
There was a problem hiding this comment.
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.
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.
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.
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.
Yeah I didn't get that far, root was the only sig I needed :D
No description provided.