From ebb4f88a80807d8e5391aca95ef573cf0ba5cd96 Mon Sep 17 00:00:00 2001 From: Lars Kanis Date: Tue, 11 Aug 2026 21:08:41 +0200 Subject: [PATCH] Remove option "quirks_mode" from JSON en/decoder The option was introduces as part of https://github.com/ged/ruby-pg/issues/248 . However the "quirks_mode" was removed short time later from json gem: https://github.com/ruby/json/commit/7d2ad6d6556da03300a5aeadeeacaec563435773 It was ignored since then, but recent ruby fails with: `ArgumentError: unknown keyword: quirks_mode` at `JSON.parse` and `JSON.generate` since that commit: https://github.com/ruby/ruby/commit/ac60d4ae4dc9aeb522d242406345e7f8834e76cd --- lib/pg/text_decoder/json.rb | 2 +- lib/pg/text_encoder/json.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pg/text_decoder/json.rb b/lib/pg/text_decoder/json.rb index 93ecd55d0..c5a4c118e 100644 --- a/lib/pg/text_decoder/json.rb +++ b/lib/pg/text_decoder/json.rb @@ -10,7 +10,7 @@ module TextDecoder # As soon as this class is used, it requires the ruby standard library 'json'. class JSON < SimpleDecoder def decode(string, tuple=nil, field=nil) - ::JSON.parse(string, quirks_mode: true) + ::JSON.parse(string) end end end diff --git a/lib/pg/text_encoder/json.rb b/lib/pg/text_encoder/json.rb index 36bbc704a..51e6a2cc9 100644 --- a/lib/pg/text_encoder/json.rb +++ b/lib/pg/text_encoder/json.rb @@ -10,7 +10,7 @@ module TextEncoder # As soon as this class is used, it requires the ruby standard library 'json'. class JSON < SimpleEncoder def encode(value) - ::JSON.generate(value, quirks_mode: true) + ::JSON.generate(value) end end end