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

Make the helpers a required argument

This commit is contained in:
Evan Phoenix 2015-02-19 15:11:08 -08:00
parent 43dae99645
commit e002a68a4e
2 changed files with 3 additions and 3 deletions

View file

@ -8,9 +8,9 @@ module ActionDispatch
attr_accessor :scope, :routes
alias :_routes :routes
def initialize(routes, scope, helpers=nil)
def initialize(routes, scope, helpers)
@routes, @scope = routes, scope
@helpers = helpers || routes.url_helpers
@helpers = helpers
end
def url_options

View file

@ -113,7 +113,7 @@ class PolymorphicRoutesTest < ActionController::TestCase
def test_passing_routes_proxy
with_namespaced_routes(:blog) do
proxy = ActionDispatch::Routing::RoutesProxy.new(_routes, self)
proxy = ActionDispatch::Routing::RoutesProxy.new(_routes, self, _routes.url_helpers)
@blog_post.save
assert_url "http://example.com/posts/#{@blog_post.id}", [proxy, @blog_post]
end