Modify new_base to use String action_names for back-compat

This commit is contained in:
Yehuda Katz + Carl Lerche
2009-05-01 16:01:37 -07:00
parent 69fd669165
commit b4903a8e34
4 changed files with 8 additions and 8 deletions

View File

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

View File

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

View File

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

View File

@@ -203,7 +203,7 @@ module AbstractController
private
def respond_to_action?(action_name)
action_name != :fail
action_name.to_s != "fail"
end
end