aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/coders/json.rb
blob: a7ad65fbf4edaac24c834304a06a83afdfe14fee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true
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) unless json.blank?
      end
    end
  end
end