diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-10-29 16:18:12 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-10-29 16:18:27 -0700 |
commit | 8941831733fc56e2b1872f41c85cc48d782bb984 (patch) | |
tree | 5676856877440afe688652530fd5e5f2359b598b | |
parent | 21a386bb0726cce4f4a5d64d55fbb55d8a2b9837 (diff) | |
download | rails-8941831733fc56e2b1872f41c85cc48d782bb984.tar.gz rails-8941831733fc56e2b1872f41c85cc48d782bb984.tar.bz2 rails-8941831733fc56e2b1872f41c85cc48d782bb984.zip |
Revert "ActionController::Base#process() now only takes an action name"
This reverts commit 9f93a5efbba3e1cbf0bfa700a17ec8d1ef60d7c6.
-rw-r--r-- | actionpack/CHANGELOG.md | 4 | ||||
-rw-r--r-- | actionpack/lib/abstract_controller/base.rb | 4 | ||||
-rw-r--r-- | actionpack/test/abstract/callbacks_test.rb | 20 |
3 files changed, 22 insertions, 6 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index 50b10e7460..4f95a9bab9 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -1,7 +1,3 @@ -* 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 c27b7b3836..4501202b8c 100644 --- a/actionpack/lib/abstract_controller/base.rb +++ b/actionpack/lib/abstract_controller/base.rb @@ -116,7 +116,7 @@ module AbstractController # # ==== Returns # * <tt>self</tt> - def process(action) + def process(action, *args) @_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) + process_action(action_name, *args) end # Delegates to the class' ::controller_path diff --git a/actionpack/test/abstract/callbacks_test.rb b/actionpack/test/abstract/callbacks_test.rb index b47aeaa08f..07571602e4 100644 --- a/actionpack/test/abstract/callbacks_test.rb +++ b/actionpack/test/abstract/callbacks_test.rb @@ -246,6 +246,26 @@ 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 |