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

ActionControllerHelpers DSL compiler should not call name directly #1354

Merged
merged 1 commit into from
Jan 16, 2023

Conversation

Morriar
Copy link
Collaborator

@Morriar Morriar commented Jan 16, 2023

Motivation

Avoid crashing if the ActionController helper redefines the name method.

Here's an example doing so: https://github.com/ViewComponent/lookbook/blob/daa8c903a34e0f051f6f40907ab583478e5959f4/lib/lookbook/support/utils/utils.rb#L10.

Implementation

We can use our own helper name_of to get the same information without crashing.

Tests

See included test.

Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
@Morriar Morriar added the bugfix label Jan 16, 2023
@Morriar Morriar requested a review from a team as a code owner January 16, 2023 18:06
@Morriar Morriar self-assigned this Jan 16, 2023
Copy link
Member

@paracycle paracycle left a comment

Choose a reason for hiding this comment

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

Thank you!

@Morriar Morriar merged commit edded15 into main Jan 16, 2023
@Morriar Morriar deleted the at-fix-action-controller-dsl branch January 16, 2023 20:29
@shopify-shipit shopify-shipit bot temporarily deployed to production February 21, 2023 12:01 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants