mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
glob_param is never used, so rm
this also changes the constructor. We don't need to pass more options than "defaults" (whatever defaults are, ugh. probably another hash of stupid stuff).
This commit is contained in:
parent
7abde1360b
commit
6d48d97947
3 changed files with 8 additions and 10 deletions
|
@ -301,7 +301,7 @@ module ActionDispatch
|
||||||
end
|
end
|
||||||
|
|
||||||
def dispatcher
|
def dispatcher
|
||||||
Routing::RouteSet::Dispatcher.new(:defaults => defaults)
|
Routing::RouteSet::Dispatcher.new(defaults)
|
||||||
end
|
end
|
||||||
|
|
||||||
def to
|
def to
|
||||||
|
|
|
@ -21,9 +21,8 @@ module ActionDispatch
|
||||||
PARAMETERS_KEY = 'action_dispatch.request.path_parameters'
|
PARAMETERS_KEY = 'action_dispatch.request.path_parameters'
|
||||||
|
|
||||||
class Dispatcher #:nodoc:
|
class Dispatcher #:nodoc:
|
||||||
def initialize(options={})
|
def initialize(defaults)
|
||||||
@defaults = options[:defaults]
|
@defaults = defaults
|
||||||
@glob_param = options.delete(:glob)
|
|
||||||
@controller_class_names = ThreadSafe::Cache.new
|
@controller_class_names = ThreadSafe::Cache.new
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -53,7 +52,6 @@ module ActionDispatch
|
||||||
def prepare_params!(params)
|
def prepare_params!(params)
|
||||||
normalize_controller!(params)
|
normalize_controller!(params)
|
||||||
merge_default_action!(params)
|
merge_default_action!(params)
|
||||||
split_glob_param!(params) if @glob_param
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# If this is a default_controller (i.e. a controller specified by the user)
|
# If this is a default_controller (i.e. a controller specified by the user)
|
||||||
|
@ -89,10 +87,6 @@ module ActionDispatch
|
||||||
def merge_default_action!(params)
|
def merge_default_action!(params)
|
||||||
params[:action] ||= 'index'
|
params[:action] ||= 'index'
|
||||||
end
|
end
|
||||||
|
|
||||||
def split_glob_param!(params)
|
|
||||||
params[@glob_param] = params[@glob_param].split('/').map { |v| URI.parser.unescape(v) }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# A NamedRouteCollection instance is a collection of named routes, and also
|
# A NamedRouteCollection instance is a collection of named routes, and also
|
||||||
|
|
|
@ -5,7 +5,11 @@ module ActionDispatch
|
||||||
module Journey
|
module Journey
|
||||||
class TestRouter < ActiveSupport::TestCase
|
class TestRouter < ActiveSupport::TestCase
|
||||||
# TODO : clean up routing tests so we don't need this hack
|
# TODO : clean up routing tests so we don't need this hack
|
||||||
class StubDispatcher < Routing::RouteSet::Dispatcher; end
|
class StubDispatcher < Routing::RouteSet::Dispatcher
|
||||||
|
def initialize
|
||||||
|
super({})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
attr_reader :routes
|
attr_reader :routes
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue