1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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.
This commit is contained in:
Aaron Patterson 2015-10-29 15:40:18 -07:00
parent 82328a563f
commit 9f93a5efbb
3 changed files with 6 additions and 22 deletions

View file

@ -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

View file

@ -116,7 +116,7 @@ module AbstractController
#
# ==== Returns
# * <tt>self</tt>
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

View file

@ -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