diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2014-07-15 08:43:18 -0700 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2014-07-15 08:43:18 -0700 |
commit | a66aeb84e215c8a6e365a7fd0197c5703a14f241 (patch) | |
tree | e7fc06a0499ba62d089fc36a4d5ea4a1d17e9e48 /activerecord/lib/active_record/coders | |
parent | dffc6a43f4df05039693380c5cd2bd8762fb0382 (diff) | |
download | rails-a66aeb84e215c8a6e365a7fd0197c5703a14f241.tar.gz rails-a66aeb84e215c8a6e365a7fd0197c5703a14f241.tar.bz2 rails-a66aeb84e215c8a6e365a7fd0197c5703a14f241.zip |
Revert "Revert "Merge pull request #16059 from jenncoop/json-serialized-attr""
This reverts commit 6f3c64eeb1dc8288dae49f114aaf619adc7dcb7f.
Conflicts:
activerecord/CHANGELOG.md
Diffstat (limited to 'activerecord/lib/active_record/coders')
-rw-r--r-- | activerecord/lib/active_record/coders/json.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/coders/json.rb b/activerecord/lib/active_record/coders/json.rb new file mode 100644 index 0000000000..0f60b6dab2 --- /dev/null +++ b/activerecord/lib/active_record/coders/json.rb @@ -0,0 +1,13 @@ +module ActiveRecord + module Coders # :nodoc: + class JSON # :nodoc: + def self.dump(obj) + ActiveSupport::JSON.encode(obj) + end + + def self.load(json) + ActiveSupport::JSON.decode(json) + end + end + end +end |