diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-01 16:01:37 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-01 17:31:02 -0700 |
commit | b4903a8e34da77b96ea136ccd015c1634a8a5c2b (patch) | |
tree | 0840acef5a6d19b397a2c2e085a2329402850914 /actionpack | |
parent | 69fd66916566f402620cc385689c36f61deb6ba1 (diff) | |
download | rails-b4903a8e34da77b96ea136ccd015c1634a8a5c2b.tar.gz rails-b4903a8e34da77b96ea136ccd015c1634a8a5c2b.tar.bz2 rails-b4903a8e34da77b96ea136ccd015c1634a8a5c2b.zip |
Modify new_base to use String action_names for back-compat
Diffstat (limited to 'actionpack')
4 files changed, 8 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/abstract/base.rb b/actionpack/lib/action_controller/abstract/base.rb index 3b85ba5565..8a8e748c0e 100644 --- a/actionpack/lib/action_controller/abstract/base.rb +++ b/actionpack/lib/action_controller/abstract/base.rb @@ -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 diff --git a/actionpack/lib/action_controller/abstract/callbacks.rb b/actionpack/lib/action_controller/abstract/callbacks.rb index c8b509081c..5f1607940a 100644 --- a/actionpack/lib/action_controller/abstract/callbacks.rb +++ b/actionpack/lib/action_controller/abstract/callbacks.rb @@ -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 diff --git a/actionpack/lib/action_controller/new_base/base.rb b/actionpack/lib/action_controller/new_base/base.rb index 00d161289e..f663900944 100644 --- a/actionpack/lib/action_controller/new_base/base.rb +++ b/actionpack/lib/action_controller/new_base/base.rb @@ -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 diff --git a/actionpack/test/abstract_controller/abstract_controller_test.rb b/actionpack/test/abstract_controller/abstract_controller_test.rb index cf6fb5140d..c283a7319d 100644 --- a/actionpack/test/abstract_controller/abstract_controller_test.rb +++ b/actionpack/test/abstract_controller/abstract_controller_test.rb @@ -203,7 +203,7 @@ module AbstractController private def respond_to_action?(action_name) - action_name != :fail + action_name.to_s != "fail" end end |