Skip to content

Instantly share code, notes, and snippets.

@jenncoop
Last active August 29, 2015 14:03
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 jenncoop/8c4142bbe59da77daa63 to your computer and use it in GitHub Desktop.
Save jenncoop/8c4142bbe59da77daa63 to your computer and use it in GitHub Desktop.
Rails Custom Coder to Restore JSON Gem Behaviour
class JSONGemCoder
def self.dump(obj)
::JSON.dump(obj)
end
def self.load(json)
::JSON.load(json)
end
end
class YourModel < ActiveRecord::Base
serialize :your_attribute, JSONGemCoder
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment