Permalink
Browse files

Ensure public superclass methods don't shadow public controller metho…

…ds. Case in point, ruby-debug's Kernel#start shadowing a controller's start action.
  • Loading branch information...
1 parent 8d72b82 commit 69e9cbb99ab111ad6b9cb2c9d8ba823ad8600bd6 @jeremy jeremy committed Aug 6, 2008
Showing with 3 additions and 3 deletions.
  1. +3 −3 actionpack/lib/action_controller/base.rb
@@ -1199,7 +1199,7 @@ def default_render #:nodoc:
end
def perform_action
- if self.class.action_methods.include?(action_name)
+ if action_methods.include?(action_name)
send(action_name)
default_render unless performed?
elsif respond_to? :method_missing
@@ -1208,7 +1208,7 @@ def perform_action
elsif template_exists? && template_public?
default_render
else
- raise UnknownAction, "No action responded to #{action_name}. Actions: #{action_methods.to_a.sort.to_sentence}", caller
+ raise UnknownAction, "No action responded to #{action_name}. Actions: #{action_methods.sort.to_sentence}", caller
end
end
@@ -1234,7 +1234,7 @@ def action_methods
end
def self.action_methods
- @action_methods ||= Set.new(public_instance_methods.map { |m| m.to_s }) - hidden_actions
+ @action_methods ||= Set.new(public_instance_methods.map { |m| m.to_s }) - hidden_actions + public_instance_methods(false).map { |m| m.to_s }
end
def add_variables_to_assigns

0 comments on commit 69e9cbb

Please sign in to comment.