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 add_controller_module': undefined method start_with?' for :bloc… #37657

Closed
wants to merge 1 commit into from
Closed

Conversation

rsmything
Copy link

@rsmything rsmything commented Nov 7, 2019

fix add_controller_module': undefined method start_with?' for :blocks:Symbol (NoMethodError)

…ks:Symbol (NoMethodError)

controller can be string or symbol
@rails-bot rails-bot bot added the actionpack label Nov 7, 2019
@schneems
Copy link
Member

schneems commented Nov 7, 2019

Is it possible to add a test the exercises this logic that would have failed without this patch?

To see what other tests hit that code try adding a raise and running the test suite, it will show you what tests exercise that logic.

@@ -355,7 +355,7 @@ def split_to(to)

def add_controller_module(controller, modyoule)
if modyoule && !controller.is_a?(Regexp)
if controller && controller.start_with?("/")
if %r{\A/}.match?(controller)
Copy link
Member

Choose a reason for hiding this comment

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

This will reintroduce the deprecation warning fixed in #37504.

We need to avoid the comparison when controller is nil:

Suggested change
if %r{\A/}.match?(controller)
if controller && %r{\A/}.match?(controller)

@louim
Copy link
Contributor

louim commented Nov 8, 2019

I think @rafaelfranca fixed it in 63256bc

@eugeneius
Copy link
Member

Yes, this is fixed on master. Thanks for the patch 🤘

@eugeneius eugeneius closed this Nov 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants