aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Nartimov <just.lest@gmail.com>2011-12-25 20:52:05 +0300
committerSergey Nartimov <just.lest@gmail.com>2011-12-25 21:17:48 +0300
commit33fb719667d0e2799efc206b8fdb9359896ddb09 (patch)
tree8e10e2e900124c4d35ea1f79608c37902d961584
parent819ea5f9af83b5a427e94c178a419fd327bf37d9 (diff)
downloadrails-33fb719667d0e2799efc206b8fdb9359896ddb09.tar.gz
rails-33fb719667d0e2799efc206b8fdb9359896ddb09.tar.bz2
rails-33fb719667d0e2799efc206b8fdb9359896ddb09.zip
ruby 1.9 returns method names as symbols
-rw-r--r--activesupport/lib/active_support/core_ext/module/method_names.rb17
1 files changed, 6 insertions, 11 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/method_names.rb b/activesupport/lib/active_support/core_ext/module/method_names.rb
index 2eb40a83ab..72d7091eb1 100644
--- a/activesupport/lib/active_support/core_ext/module/method_names.rb
+++ b/activesupport/lib/active_support/core_ext/module/method_names.rb
@@ -1,14 +1,9 @@
class Module
- if instance_methods[0].is_a?(Symbol)
- def instance_method_names(*args)
- instance_methods(*args).map(&:to_s)
- end
+ def instance_method_names(*args)
+ instance_methods(*args).map { |name| name.to_s }
+ end
- def method_names(*args)
- methods(*args).map(&:to_s)
- end
- else
- alias_method :instance_method_names, :instance_methods
- alias_method :method_names, :methods
+ def method_names(*args)
+ methods(*args).map { |name| name.to_s }
end
-end \ No newline at end of file
+end