Skip to content

Instantly share code, notes, and snippets.

@pkieltyka
Created September 7, 2012 20:19
Show Gist options
  • Save pkieltyka/3669280 to your computer and use it in GitHub Desktop.
Save pkieltyka/3669280 to your computer and use it in GitHub Desktop.
require 'activesupport' # assuming this is already loaded by some dependency..
require 'json'
if defined?(ActiveSupport::JSON)
[Object, Array, FalseClass, Float, Hash, Integer, NilClass, String, TrueClass].each do |klass|
klass.class_eval do
def to_json(*args)
super(args)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment