diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-08-05 17:33:51 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-08-05 17:35:08 -0700 |
commit | 69e9cbb99ab111ad6b9cb2c9d8ba823ad8600bd6 (patch) | |
tree | ff23c9ace3c3785ff7f388bc5aeafbe5a6ade341 /actionpack | |
parent | 8d72b82b8da99eda9ba654b3d3a4da847a212406 (diff) | |
download | rails-69e9cbb99ab111ad6b9cb2c9d8ba823ad8600bd6.tar.gz rails-69e9cbb99ab111ad6b9cb2c9d8ba823ad8600bd6.tar.bz2 rails-69e9cbb99ab111ad6b9cb2c9d8ba823ad8600bd6.zip |
Ensure public superclass methods don't shadow public controller methods. Case in point, ruby-debug's Kernel#start shadowing a controller's start action.
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/base.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 5689a9825e..c50e255c98 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -1199,7 +1199,7 @@ module ActionController #: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 @@ module ActionController #:nodoc: 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 @@ module ActionController #:nodoc: 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 |