blob: 97025ae4d3e5b8866b85a611452152d4830699e9 (
plain) (
tree)
|
|
module ActiveRecord #:nodoc:
module Serialization
def to_json(options = {}, &block)
JsonSerializer.new(self, options).to_s
end
def from_json(json)
self.attributes = ActiveSupport::JSON.decode(json)
self
end
class JsonSerializer < ActiveRecord::Serialization::Serializer #:nodoc:
def serialize
serializable_record.to_json
end
end
end
end
|