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



6
7
8
# File 'activerecord/lib/active_record/coders/json.rb', line 6

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

.load(json) ⇒ Object



10
11
12
# File 'activerecord/lib/active_record/coders/json.rb', line 10

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