aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/coders/json.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/coders/json.rb')
-rw-r--r--activerecord/lib/active_record/coders/json.rb13
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