diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-06-10 14:43:43 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-06-10 14:43:43 -0700 |
commit | 82a10ce9f61a02a97d85915bb5fca53730ae28c8 (patch) | |
tree | 6563772a205fd6b95dd79b068fe3951b5048724e | |
parent | fbb6b936e9b896e6b8cbd6d05148a77fcf14b40b (diff) | |
download | rails-82a10ce9f61a02a97d85915bb5fca53730ae28c8.tar.gz rails-82a10ce9f61a02a97d85915bb5fca53730ae28c8.tar.bz2 rails-82a10ce9f61a02a97d85915bb5fca53730ae28c8.zip |
Removed unnecessary code
-rw-r--r-- | actionpack/lib/action_controller/new_base/hide_actions.rb | 39 | ||||
-rw-r--r-- | actionpack/lib/action_controller/new_base/http.rb | 10 |
2 files changed, 17 insertions, 32 deletions
diff --git a/actionpack/lib/action_controller/new_base/hide_actions.rb b/actionpack/lib/action_controller/new_base/hide_actions.rb index b45e520bee..86852a26cd 100644 --- a/actionpack/lib/action_controller/new_base/hide_actions.rb +++ b/actionpack/lib/action_controller/new_base/hide_actions.rb @@ -1,39 +1,34 @@ module ActionController + # ActionController::HideActions adds the ability to prevent public methods on a controller + # to be called as actions. module HideActions extend ActiveSupport::Concern included do - extlib_inheritable_accessor :hidden_actions - self.hidden_actions ||= Set.new + extlib_inheritable_accessor(:hidden_actions) { Set.new } end def action_methods - self.class.action_names + self.class.action_methods end - def action_names - action_methods - end - - private - def action_method?(action_name) - !hidden_actions.include?(action_name) && super - end + private - module ClassMethods - def hide_action(*args) - args.each do |arg| - self.hidden_actions << arg.to_s - end - end + def action_method?(action_name) + !hidden_actions.include?(action_name) && super + end - def action_methods - @action_names ||= Set.new(super.reject {|name| self.hidden_actions.include?(name.to_s)}) + module ClassMethods + # Sets + def hide_action(*args) + args.each do |arg| + self.hidden_actions << arg.to_s end + end - def self.action_names - action_methods - end + def action_methods + @action_methods ||= Set.new(super.reject {|name| self.hidden_actions.include?(name.to_s)}) end + end end end diff --git a/actionpack/lib/action_controller/new_base/http.rb b/actionpack/lib/action_controller/new_base/http.rb index c96aaaa865..b3a80094dd 100644 --- a/actionpack/lib/action_controller/new_base/http.rb +++ b/actionpack/lib/action_controller/new_base/http.rb @@ -28,16 +28,6 @@ module ActionController self.class.controller_path end - # :api: private - def self.action_names - action_methods - end - - # :api: private - def action_names - action_methods - end - # :api: plugin def self.call(env) controller = new |