mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Modify new_base to use String action_names for back-compat
This commit is contained in:
@@ -21,7 +21,7 @@ module AbstractController
|
||||
end
|
||||
|
||||
def process(action)
|
||||
new.process(action)
|
||||
new.process(action.to_s)
|
||||
end
|
||||
|
||||
def hidden_actions
|
||||
@@ -31,11 +31,11 @@ module AbstractController
|
||||
def action_methods
|
||||
@action_methods ||=
|
||||
# All public instance methods of this class, including ancestors
|
||||
public_instance_methods(true).map { |m| m.to_sym }.to_set -
|
||||
public_instance_methods(true).map { |m| m.to_s }.to_set -
|
||||
# Except for public instance methods of Base and its ancestors
|
||||
internal_methods.map { |m| m.to_sym } +
|
||||
internal_methods.map { |m| m.to_s } +
|
||||
# Be sure to include shadowed public instance methods of this class
|
||||
public_instance_methods(false).map { |m| m.to_sym } -
|
||||
public_instance_methods(false).map { |m| m.to_s } -
|
||||
# And always exclude explicitly hidden actions
|
||||
hidden_actions
|
||||
end
|
||||
|
||||
@@ -14,11 +14,11 @@ module AbstractController
|
||||
module ClassMethods
|
||||
def _normalize_callback_options(options)
|
||||
if only = options[:only]
|
||||
only = Array(only).map {|o| "action_name == :#{o}"}.join(" || ")
|
||||
only = Array(only).map {|o| "action_name == '#{o}'"}.join(" || ")
|
||||
options[:per_key] = {:if => only}
|
||||
end
|
||||
if except = options[:except]
|
||||
except = Array(except).map {|e| "action_name == :#{e}"}.join(" || ")
|
||||
except = Array(except).map {|e| "action_name == '#{e}'"}.join(" || ")
|
||||
options[:per_key] = {:unless => except}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -42,7 +42,7 @@ module ActionController
|
||||
def call(env)
|
||||
@_request = ActionDispatch::Request.new(env)
|
||||
@_response = ActionDispatch::Response.new
|
||||
process(@_request.parameters[:action].to_sym)
|
||||
process(@_request.parameters[:action])
|
||||
@_response.body = response_body
|
||||
@_response.prepare!
|
||||
self
|
||||
|
||||
@@ -203,7 +203,7 @@ module AbstractController
|
||||
private
|
||||
|
||||
def respond_to_action?(action_name)
|
||||
action_name != :fail
|
||||
action_name.to_s != "fail"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user