Skip to content

Commit

Permalink
Override Ruby 1.8.7's incompatible Symbol#to_proc.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy committed Apr 18, 2008
1 parent 7e5aa65 commit db11ef9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion activesupport/lib/active_support/core_ext/symbol.rb
@@ -1,4 +1,11 @@
unless :test.respond_to?(:to_proc)
# Remove 1.8.7's incompatible method.
if :to_proc.respond_to?(:to_proc) && [1] != ([[1, 2]].map(&:first) rescue false)
class Symbol
remove_method :to_proc
end
end

unless :to_proc.respond_to?(:to_proc)
class Symbol
# Turns the symbol into a simple proc, which is especially useful for enumerations. Examples:
#
Expand Down

0 comments on commit db11ef9

Please sign in to comment.