Skip to content

Add sigs for Rails::Engine.root - #319

Closed
amomchilov wants to merge 2 commits into
mainfrom
amomchilov/improve-railtie-rbi
Closed

amomchilov wants to merge 2 commits into
mainfrom
amomchilov/improve-railtie-rbi

Conversation

@amomchilov

Copy link
Copy Markdown
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 KaanOzkan and egiurleo May 7, 2025 22:46
@amomchilov amomchilov self-assigned this May 7, 2025
@amomchilov

Copy link
Copy Markdown
Contributor Author

Comment thread rbi/annotations/railties.rbi
@Morriar

Morriar commented May 8, 2025 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

@Morriar Morriar May 8, 2025 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@amomchilov amomchilov May 8, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

@KaanOzkan
KaanOzkan removed their request for review May 26, 2025 13:37
@egiurleo
egiurleo removed their request for review August 14, 2026 14:31
@KaanOzkan

Copy link
Copy Markdown
Contributor

Superseded by #411 and #372

@KaanOzkan KaanOzkan closed this Sep 4, 2026
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.

6 participants