diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-27 14:46:04 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-27 14:46:04 -0700 |
commit | 2ffa126f7921462a91595744a3ed345fd965138f (patch) | |
tree | 24781149226f66bd1451026239575263fd38fd69 /actionpack/lib | |
parent | cfdab77d1fd39a887e9d94342e4e85f915a5b00b (diff) | |
download | rails-2ffa126f7921462a91595744a3ed345fd965138f.tar.gz rails-2ffa126f7921462a91595744a3ed345fd965138f.tar.bz2 rails-2ffa126f7921462a91595744a3ed345fd965138f.zip |
PARAMETERS_KEY is only used in the request, so move the constant there
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/http/parameters.rb | 6 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/http/parameters.rb b/actionpack/lib/action_dispatch/http/parameters.rb index ff555f93a8..0003dd6bfc 100644 --- a/actionpack/lib/action_dispatch/http/parameters.rb +++ b/actionpack/lib/action_dispatch/http/parameters.rb @@ -4,6 +4,8 @@ require 'active_support/core_ext/hash/indifferent_access' module ActionDispatch module Http module Parameters + PARAMETERS_KEY = 'action_dispatch.request.path_parameters' + def initialize(env) super @symbolized_path_params = nil @@ -25,7 +27,7 @@ module ActionDispatch def path_parameters=(parameters) #:nodoc: @env.delete('action_dispatch.request.parameters') - @env[Routing::RouteSet::PARAMETERS_KEY] = parameters + @env[PARAMETERS_KEY] = parameters end # The same as <tt>path_parameters</tt> with explicitly symbolized keys. @@ -40,7 +42,7 @@ module ActionDispatch # # See <tt>symbolized_path_parameters</tt> for symbolized keys. def path_parameters - @env[Routing::RouteSet::PARAMETERS_KEY] ||= {} + @env[PARAMETERS_KEY] ||= {} end private diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 8777a9cd71..3ca5abf0fd 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -19,8 +19,6 @@ module ActionDispatch # alias inspect to to_s. alias inspect to_s - PARAMETERS_KEY = 'action_dispatch.request.path_parameters' - class Dispatcher < Routing::Endpoint #:nodoc: def initialize(defaults) @defaults = defaults |