From 2a05a72e6a2ff8b7e931b7849e2482f376a57a36 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 12 Aug 2015 15:54:24 -0700 Subject: store `via` outside the options hash Now we don't have to manually remove this from the options hash since the scope stores it outside of "options" --- actionpack/lib/action_dispatch/routing/mapper.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index e7c24b6f04..00fe350276 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -70,7 +70,6 @@ module ActionDispatch options.delete :shallow_prefix options.delete :shallow options.delete :format - options.delete :via defaults = (scope[:defaults] || {}).dup scope_constraints = scope[:constraints] || {} @@ -991,6 +990,10 @@ module ActionDispatch child end + def merge_via_scope(parent, child) #:nodoc: + child + end + def merge_path_names_scope(parent, child) #:nodoc: merge_options_scope(parent, child) end @@ -1546,7 +1549,7 @@ module ActionDispatch option_path = options.delete :path to = options.delete :to via = Mapping.check_via Array(options.delete(:via) { - @scope.mapping_option(:via) + @scope[:via] }) path_types = paths.group_by(&:class) @@ -1940,7 +1943,7 @@ module ActionDispatch class Scope # :nodoc: OPTIONS = [:path, :shallow_path, :as, :shallow_prefix, :module, :controller, :action, :path_names, :constraints, - :shallow, :blocks, :defaults, :options] + :shallow, :blocks, :defaults, :via, :options] RESOURCE_SCOPES = [:resource, :resources] RESOURCE_METHOD_SCOPES = [:collection, :member, :new] -- cgit v1.2.3