Skip to content
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

Fix breadcrumbs for flattened class declarations #311

Merged

Conversation

jonathanhefner
Copy link
Member

When declaring a class with a flattened name like class Foo::Bar rather than module Foo; class Bar, RDoc does not return a parent object for Bar. Note this only applies to classes. When Bar is merely a module, RDoc does return a parent object.

That behavior caused module_breadcrumbs to return only the class's name in such cases. This commit fixes module_breadcrumbs to work around that behavior and always return all breadcrumbs.

When declaring a class with a flattened name like `class Foo::Bar`
rather than `module Foo; class Bar`, RDoc does not return a parent
object for `Bar`.  Note this only applies to classes.  When `Bar` is
merely a module, RDoc _does_ return a parent object.

That behavior caused `module_breadcrumbs` to return only the class's
name in such cases.  This commit fixes `module_breadcrumbs` to work
around that behavior and always return all breadcrumbs.
@jonathanhefner jonathanhefner merged commit 444c4a4 into rails:main Sep 28, 2023
9 checks passed
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.

1 participant