aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/new_base/hide_actions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/new_base/hide_actions.rb')
-rw-r--r--actionpack/lib/action_controller/new_base/hide_actions.rb48
1 files changed, 27 insertions, 21 deletions
diff --git a/actionpack/lib/action_controller/new_base/hide_actions.rb b/actionpack/lib/action_controller/new_base/hide_actions.rb
index a29b09a893..b45e520bee 100644
--- a/actionpack/lib/action_controller/new_base/hide_actions.rb
+++ b/actionpack/lib/action_controller/new_base/hide_actions.rb
@@ -1,33 +1,39 @@
module ActionController
module HideActions
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
included do
extlib_inheritable_accessor :hidden_actions
self.hidden_actions ||= Set.new
end
- def action_methods() self.class.action_names end
- def action_names() action_methods end
-
- private
-
- def action_method?(action_name)
- !hidden_actions.include?(action_name) && super
+ def action_methods
+ self.class.action_names
end
-
- module ClassMethods
- def hide_action(*args)
- args.each do |arg|
- self.hidden_actions << arg.to_s
- end
- end
-
- def action_methods
- @action_names ||= Set.new(super.reject {|name| self.hidden_actions.include?(name.to_s)})
- end
- def self.action_names() action_methods end
+ def action_names
+ action_methods
end
+
+ private
+ def action_method?(action_name)
+ !hidden_actions.include?(action_name) && super
+ end
+
+ module ClassMethods
+ def hide_action(*args)
+ args.each do |arg|
+ self.hidden_actions << arg.to_s
+ end
+ end
+
+ def action_methods
+ @action_names ||= Set.new(super.reject {|name| self.hidden_actions.include?(name.to_s)})
+ end
+
+ def self.action_names
+ action_methods
+ end
+ end
end
-end \ No newline at end of file
+end