We should finalize the routes as soon as possible and not wait for the controller to be loaded.

This commit is contained in:
José Valim 2012-01-06 17:04:34 +01:00
parent 3853b73bf8
commit 0db93941a4
2 changed files with 1 additions and 3 deletions

@ -533,7 +533,6 @@ def _generate_prefix(options = {})
end
def url_for(options)
finalize!
options = (options || {}).reverse_merge!(default_url_options)
handle_positional_args(options)
@ -559,7 +558,6 @@ def url_for(options)
end
def call(env)
finalize!
@router.call(env)
end

@ -42,7 +42,7 @@ def load_paths
def finalize!
route_sets.each do |routes|
ActiveSupport.on_load(:action_controller) { routes.finalize! }
routes.finalize!
end
end