lib/action_controller/metal/hide_actions.rb in actionpack-3.0.0.beta4 vs lib/action_controller/metal/hide_actions.rb in actionpack-3.0.0.rc

- old
+ new

@@ -6,11 +6,11 @@ module HideActions extend ActiveSupport::Concern included do class_attribute :hidden_actions - self.hidden_actions = Set.new + self.hidden_actions = Set.new.freeze end private # Overrides AbstractController::Base#action_method? to return false if the @@ -23,11 +23,11 @@ # Sets all of the actions passed in as hidden actions. # # ==== Parameters # *args<#to_s>:: A list of actions def hide_action(*args) - self.hidden_actions = hidden_actions.dup.merge(args.map(&:to_s)) + self.hidden_actions = hidden_actions.dup.merge(args.map(&:to_s)).freeze end def inherited(klass) klass.class_eval { @visible_actions = {} } super @@ -39,10 +39,10 @@ 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) }) end end end end