Skip to content

Instantly share code, notes, and snippets.

@kenn
Created July 5, 2013 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenn/5937325 to your computer and use it in GitHub Desktop.
Save kenn/5937325 to your computer and use it in GitHub Desktop.
# Undo require 'active_support/core_ext/object/to_json'
require 'yajl'
[Object, Array, Hash].each do |klass|
klass.class_eval <<-RUBY, __FILE__, __LINE__
def jsonize(options = nil)
::Yajl::Encoder.encode(self)
end
RUBY
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment