Class: ActiveRecord::Coders::JSON

Inherits:
Object
  • Object
show all
Defined in:
activerecord/lib/active_record/coders/json.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.dump(obj) ⇒ Object


4
5
6
# File 'activerecord/lib/active_record/coders/json.rb', line 4

def self.dump(obj)
  ActiveSupport::JSON.encode(obj)
end

.load(json) ⇒ Object


8
9
10
# File 'activerecord/lib/active_record/coders/json.rb', line 8

def self.load(json)
  ActiveSupport::JSON.decode(json) unless json.nil?
end