Skip to content

Instantly share code, notes, and snippets.

@tammymakesthings
Forked from chudler/gist:1473140
Created January 26, 2012 21:28
Show Gist options
  • Save tammymakesthings/1685228 to your computer and use it in GitHub Desktop.
Save tammymakesthings/1685228 to your computer and use it in GitHub Desktop.
############################################
# 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