8000 Add sigs for `Rails::Engine.root` by amomchilov · Pull Request #319 · Shopify/rbi-central · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

amomchilov
Copy link
Contributor

No description provided.

@amomchilov amomchilov requested a review from a team as a code owner May 7, 2025 22:46
@amomchilov amomchilov requested review from egiurleo and KaanOzkan May 7, 2025 22:46
@amomchilov amomchilov self-assigned this May 7, 2025
@amomchilov
Copy link
Contributor Author

@Morriar
Copy link
Contributor
Morriar commented May 8, 2025

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
Copy link
Member

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.

Copy link
Contributor
@Morriar Morriar May 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author
@amomchilov amomchilov May 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

method_missing 🤮

https://github.com/rails/rails/blob/747f85f200e7bb2c1a31b4e26e5a5655e2dc0cdc/railties/lib/rails/railtie.rb#L221-L229

Right, but also that means all class methods are delegated to instance methods, not just root.

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0