aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthedarkone <thedarkone2@gmail.com>2012-06-30 17:09:12 +0200
committerPrem Sichanugrist <s@sikac.hu>2013-02-24 16:32:25 -0500
commitabf0c710210440e50b33b3e708b1e7e1dfbf9d65 (patch)
treeae2b4db0b81f60af594be48bf56597bccb2cc910
parent42d7927c22a2c219d6145d9375be65a04a83dce3 (diff)
downloadrails-abf0c710210440e50b33b3e708b1e7e1dfbf9d65.tar.gz
rails-abf0c710210440e50b33b3e708b1e7e1dfbf9d65.tar.bz2
rails-abf0c710210440e50b33b3e708b1e7e1dfbf9d65.zip
There is already a Set of non-hidden action_names lying around.
-rw-r--r--actionpack/lib/action_controller/metal/hide_actions.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/metal/hide_actions.rb b/actionpack/lib/action_controller/metal/hide_actions.rb
index b55c4643be..109484d88c 100644
--- a/actionpack/lib/action_controller/metal/hide_actions.rb
+++ b/actionpack/lib/action_controller/metal/hide_actions.rb
@@ -27,20 +27,14 @@ module ActionController
self.hidden_actions = hidden_actions.dup.merge(args.map(&:to_s)).freeze
end
- def inherited(klass)
- klass.class_eval { @visible_actions = {} }
- super
- end
-
def visible_action?(action_name)
- return @visible_actions[action_name] if @visible_actions.key?(action_name)
- @visible_actions[action_name] = !hidden_actions.include?(action_name)
+ action_methods.include?(action_name)
end
# Overrides AbstractController::Base#action_methods to remove any methods
# that are listed as hidden methods.
def action_methods
- @action_methods ||= Set.new(super.reject { |name| hidden_actions.include?(name) })
+ @action_methods ||= Set.new(super.reject { |name| hidden_actions.include?(name) }).freeze
end
end
end