mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
the request class is never changed, so just use it directly in the method body
This commit is contained in:
parent
9645820bdb
commit
4485351501
2 changed files with 6 additions and 6 deletions
|
@ -232,13 +232,13 @@ module ActionController
|
|||
end
|
||||
|
||||
# Returns a Rack endpoint for the given action name.
|
||||
def self.action(name, klass = ActionDispatch::Request)
|
||||
def self.action(name)
|
||||
if middleware_stack.any?
|
||||
middleware_stack.build(name) do |env|
|
||||
new.dispatch(name, klass.new(env))
|
||||
new.dispatch(name, ActionDispatch::Request.new(env))
|
||||
end
|
||||
else
|
||||
lambda { |env| new.dispatch(name, klass.new(env)) }
|
||||
lambda { |env| new.dispatch(name, ActionDispatch::Request.new(env)) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -39,7 +39,7 @@ module ActionDispatch
|
|||
return [404, {'X-Cascade' => 'pass'}, []]
|
||||
end
|
||||
|
||||
dispatch(controller, params[:action], req.env)
|
||||
dispatch(controller, params[:action], req)
|
||||
end
|
||||
|
||||
def prepare_params!(params)
|
||||
|
@ -69,8 +69,8 @@ module ActionDispatch
|
|||
ActiveSupport::Dependencies.constantize(const_name)
|
||||
end
|
||||
|
||||
def dispatch(controller, action, env)
|
||||
controller.action(action).call(env)
|
||||
def dispatch(controller, action, req)
|
||||
controller.action(action).call(req.env)
|
||||
end
|
||||
|
||||
def normalize_controller!(params)
|
||||
|
|
Loading…
Reference in a new issue