diff options
author | José Valim <jose.valim@gmail.com> | 2011-05-03 01:03:21 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-05-03 01:04:57 +0200 |
commit | a55f2de0c5baae589b1730df1e4068f0cd1474ce (patch) | |
tree | 34ea073190afa3287f00cf82408c9766497e5682 /actionpack/lib/action_controller/metal | |
parent | 1afb56f4818381098c6ed0babc4a5899e324e2e5 (diff) | |
download | rails-a55f2de0c5baae589b1730df1e4068f0cd1474ce.tar.gz rails-a55f2de0c5baae589b1730df1e4068f0cd1474ce.tar.bz2 rails-a55f2de0c5baae589b1730df1e4068f0cd1474ce.zip |
Improve performance for filtered parameters and add tests.
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r-- | actionpack/lib/action_controller/metal/instrumentation.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_controller/metal/params_wrapper.rb | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/metal/instrumentation.rb b/actionpack/lib/action_controller/metal/instrumentation.rb index dc3ea939e6..4e54c2ad88 100644 --- a/actionpack/lib/action_controller/metal/instrumentation.rb +++ b/actionpack/lib/action_controller/metal/instrumentation.rb @@ -14,7 +14,7 @@ module ActionController attr_internal :view_runtime - def process_action(action, *args) + def process_action(*args) raw_payload = { :controller => self.class.name, :action => self.action_name, diff --git a/actionpack/lib/action_controller/metal/params_wrapper.rb b/actionpack/lib/action_controller/metal/params_wrapper.rb index 3262e24f67..d128f6d03c 100644 --- a/actionpack/lib/action_controller/metal/params_wrapper.rb +++ b/actionpack/lib/action_controller/metal/params_wrapper.rb @@ -178,14 +178,13 @@ module ActionController def process_action(*args) if _wrapper_enabled? wrapped_hash = { _wrapper_key => request.request_parameters.slice(*_wrapped_keys) } - wrapped_filtered_hash = { _wrapper_key => request.filtered_parameters.slice(*_wrapped_keys) } # This will make the wrapped hash accessible from controller and view request.parameters.merge! wrapped_hash request.request_parameters.merge! wrapped_hash # This will make the wrapped hash displayed in the log file - request.filtered_parameters.merge! wrapped_filtered_hash + request.clear_filtered_parameters end super end @@ -215,7 +214,7 @@ module ActionController # Checks if we should perform parameters wrapping. def _wrapper_enabled? ref = request.content_mime_type.try(:ref) - _wrapper_formats.any? { |format| format == ref } && !request.request_parameters[_wrapper_key] + _wrapper_formats.include?(ref) && !request.request_parameters[_wrapper_key] end end end |