From 9f93a5efbba3e1cbf0bfa700a17ec8d1ef60d7c6 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 29 Oct 2015 15:40:18 -0700 Subject: ActionController::Base#process() now only takes an action name rather than an action name and *args. The *args were not being used in regular applications outside tests. This causes a backwards compatibility issue, but reduces array allocations for most users. --- actionpack/CHANGELOG.md | 4 ++++ actionpack/lib/abstract_controller/base.rb | 4 ++-- actionpack/test/abstract/callbacks_test.rb | 20 -------------------- 3 files changed, 6 insertions(+), 22 deletions(-) (limited to 'actionpack') diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index 4f95a9bab9..50b10e7460 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -1,3 +1,7 @@ +* ActionController::Base#process() now only takes an action name, rather + than an action name and *args. The *args were not being used in regular + applications outside tests. + * Catch invalid UTF-8 querystring values and respond with BadRequest Check querystring params for invalid UTF-8 characters, and raise an diff --git a/actionpack/lib/abstract_controller/base.rb b/actionpack/lib/abstract_controller/base.rb index 4501202b8c..c27b7b3836 100644 --- a/actionpack/lib/abstract_controller/base.rb +++ b/actionpack/lib/abstract_controller/base.rb @@ -116,7 +116,7 @@ module AbstractController # # ==== Returns # * self - def process(action, *args) + def process(action) @_action_name = action.to_s unless action_name = _find_action_name(@_action_name) @@ -125,7 +125,7 @@ module AbstractController @_response_body = nil - process_action(action_name, *args) + process_action(action_name) end # Delegates to the class' ::controller_path diff --git a/actionpack/test/abstract/callbacks_test.rb b/actionpack/test/abstract/callbacks_test.rb index 07571602e4..b47aeaa08f 100644 --- a/actionpack/test/abstract/callbacks_test.rb +++ b/actionpack/test/abstract/callbacks_test.rb @@ -246,26 +246,6 @@ module AbstractController end end - class CallbacksWithArgs < ControllerWithCallbacks - set_callback :process_action, :before, :first - - def first - @text = "Hello world" - end - - def index(text) - self.response_body = @text + text - end - end - - class TestCallbacksWithArgs < ActiveSupport::TestCase - test "callbacks still work when invoking process with multiple arguments" do - controller = CallbacksWithArgs.new - controller.process(:index, " Howdy!") - assert_equal "Hello world Howdy!", controller.response_body - end - end - class AliasedCallbacks < ControllerWithCallbacks ActiveSupport::Deprecation.silence do before_filter :first -- cgit v1.2.3