Sha256: 74085bbe2abfaf8ee53260921f6c0ca56e5227c2dc5e007f5bab5b3bdc97f357
Contents?: true
Size: 530 Bytes
Versions: 8
Compression:
Stored size: 530 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
8 entries across 8 versions & 1 rubygems
Version | Path |
---|---|
oj-3.16.9 | test/prec.rb |
oj-3.16.8 | test/prec.rb |
oj-3.16.7 | test/prec.rb |
oj-3.16.6 | test/prec.rb |
oj-3.16.5 | test/prec.rb |
oj-3.16.4 | test/prec.rb |
oj-3.16.3 | test/prec.rb |
oj-3.16.0 | test/prec.rb |