1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Named routes are public methods

This commit is contained in:
Akira Matsuda 2020-10-02 12:55:17 +09:00
parent dbd30b0d27
commit 35a15af7a5
2 changed files with 2 additions and 2 deletions

View file

@ -182,7 +182,7 @@ module ActionDispatch
# ROUTES TODO: These assertions should really work in an integration context
def method_missing(selector, *args, &block)
if defined?(@controller) && @controller && defined?(@routes) && @routes && @routes.named_routes.route_defined?(selector)
@controller.send(selector, *args, &block)
@controller.public_send(selector, *args, &block)
else
super
end

View file

@ -1326,7 +1326,7 @@ class ResourcesTest < ActionController::TestCase
end
def assert_named_route(expected, route, options)
actual = @controller.send(route, options) rescue $!.class.name
actual = @controller.public_send(route, options) rescue $!.class.name
assert_equal expected, actual, "Error on route: #{route}(#{options.inspect})"
end