Created
May 9, 2012 13:36
-
-
Save dbi/2644564 to your computer and use it in GitHub Desktop.
Sniffing for Array#to_s usage before upgrading to ruby 1.9 (where the behaviour changes)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Log Array#to_s to make sure we are not using it and expeting the Ruby 1.8.x behaviour | |
class Array | |
alias :_to_s :to_s | |
def to_s(*args) | |
Rails.logger.warn "Was calling Array#to_s from #{caller.first.split(":in").first}" | |
_to_s(*args) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment