aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/mapper.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-08-12 15:54:24 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-08-12 15:54:24 -0700
commit2a05a72e6a2ff8b7e931b7849e2482f376a57a36 (patch)
tree6c977e6272a2196d4ef7442192442cf4b67067ab /actionpack/lib/action_dispatch/routing/mapper.rb
parentf514c9c04aeef8b2a90dc1bfc97d7dff833bdcd8 (diff)
downloadrails-2a05a72e6a2ff8b7e931b7849e2482f376a57a36.tar.gz
rails-2a05a72e6a2ff8b7e931b7849e2482f376a57a36.tar.bz2
rails-2a05a72e6a2ff8b7e931b7849e2482f376a57a36.zip
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"
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb9
1 files changed, 6 insertions, 3 deletions
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]