-
-
Save tammymakesthings/1685228 to your computer and use it in GitHub Desktop.
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
############################################ | |
# In lib/do_evil_things_to_strings.rb | |
############################################ | |
class String | |
old_is_utf8 = instance_method(:is_utf8?) | |
define_method(:is_utf8?) do | |
return false if calling_method == 'quote' | |
old_is_utf8.bind(self).() | |
end | |
end | |
############################################ | |
# In config/initializers/load_monkeypatch.rb | |
############################################ | |
$:.unshift(File.expand_path(File.join(::Rails.root, 'lib'))) | |
require 'do_evil_things_to_strings' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment