Class: ActiveRecord::Coders::JSON

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

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.dump(obj) ⇒ Object



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

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

.load(json) ⇒ Object



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

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