aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-03-10 18:36:00 -0200
committerSantiago Pastorino <santiago@wyeworks.com>2012-03-10 18:37:30 -0200
commit4751a699c9d20118e84dd657a96282329fc8bf85 (patch)
tree4c052278fa3eb746cc220540878954f2b304ae20
parentb0a93d650fd6299c3e83e2c7f9531923b88028da (diff)
downloadrails-4751a699c9d20118e84dd657a96282329fc8bf85.tar.gz
rails-4751a699c9d20118e84dd657a96282329fc8bf85.tar.bz2
rails-4751a699c9d20118e84dd657a96282329fc8bf85.zip
AbstractController.action_methods should return a Set
-rw-r--r--actionpack/lib/abstract_controller/base.rb5
-rw-r--r--actionpack/test/abstract/abstract_controller_test.rb2
2 files changed, 4 insertions, 3 deletions
diff --git a/actionpack/lib/abstract_controller/base.rb b/actionpack/lib/abstract_controller/base.rb
index 43cea3b79e..b068846a13 100644
--- a/actionpack/lib/abstract_controller/base.rb
+++ b/actionpack/lib/abstract_controller/base.rb
@@ -1,4 +1,5 @@
require 'erubis'
+require 'set'
require 'active_support/configurable'
require 'active_support/descendants_tracker'
require 'active_support/core_ext/module/anonymous'
@@ -59,7 +60,7 @@ module AbstractController
# itself. Finally, #hidden_actions are removed.
#
# ==== Returns
- # * <tt>array</tt> - A list of all methods that should be considered actions.
+ # * <tt>set</tt> - A set of all methods that should be considered actions.
def action_methods
@action_methods ||= begin
# All public instance methods of this class, including ancestors
@@ -72,7 +73,7 @@ module AbstractController
hidden_actions.to_a
# Clear out AS callback method pollution
- methods.reject { |method| method =~ /_one_time_conditions/ }
+ Set.new(methods.reject { |method| method =~ /_one_time_conditions/ })
end
end
diff --git a/actionpack/test/abstract/abstract_controller_test.rb b/actionpack/test/abstract/abstract_controller_test.rb
index bf068aedcd..a59a9a3767 100644
--- a/actionpack/test/abstract/abstract_controller_test.rb
+++ b/actionpack/test/abstract/abstract_controller_test.rb
@@ -254,7 +254,7 @@ module AbstractController
class TestActionMethodsReloading < ActiveSupport::TestCase
test "action_methods should be reloaded after defining a new method" do
- assert_equal ["index"], Me6.action_methods
+ assert_equal Set.new(["index"]), Me6.action_methods
end
end