Skip to content

Instantly share code, notes, and snippets.

@jeffrydegrande
Created April 22, 2010 17:47
Show Gist options
  • Save jeffrydegrande/375548 to your computer and use it in GitHub Desktop.
Save jeffrydegrande/375548 to your computer and use it in GitHub Desktop.
class Thing < ActiveRecord::Base
def to_json
old_value = ActiveRecord::Base.include_root_in_json
ActiveRecord::Base.include_root_in_json = false
json = super
ActiveRecord::Base.include_root_in_json = old_value
json
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment