Permalink
Browse files

There is already a Set of non-hidden action_names lying around.

  • Loading branch information...
1 parent 42d7927 commit abf0c710210440e50b33b3e708b1e7e1dfbf9d65 @thedarkone thedarkone committed with sikachu Jun 30, 2012
Showing with 2 additions and 8 deletions.
  1. +2 −8 actionpack/lib/action_controller/metal/hide_actions.rb
@@ -27,20 +27,14 @@ def hide_action(*args)
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

0 comments on commit abf0c71

Please sign in to comment.