Sha256: 26541aa29220d6f495c0ba12dabc6a9b1366564d218eb269efed461fe97380ba
Contents?: true
Size: 522 Bytes
Versions: 53
Compression:
Stored size: 522 Bytes
Contents
# frozen_string_literal: true require 'oj' extras = {"locationLng" => -97.14690769100295} Oj.default_options = {float_precision: 17} encoded = Oj.dump(extras) puts encoded puts Oj.load(encoded) require "active_record" Oj::Rails.set_encoder() Oj::Rails.set_decoder() Oj.default_options = {float_precision: 17} # Using Oj rails encoder, gets the correct value: {"locationLng":-97.14690769100295} encoded = ActiveSupport::JSON.encode(extras) puts encoded puts ActiveSupport::JSON.decode(encoded) puts Oj.load(encoded)
Version data entries
53 entries across 53 versions & 2 rubygems