oj_serializers 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/oj_serializers/setup.rb +7 -1
- data/lib/oj_serializers/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8bbb93696ca1b7eb5e3daac8a7a8eaaf2d66331733ae170a6d2d64f15520a0b7
|
|
4
|
+
data.tar.gz: 9356aad11f17a314aa66d7c99d6428b116ae0d7fcd8e36400b27175e428ab6f0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6dab9b921059a3ecc572f58ada7eca96e21c3cfed14ebd7ddc50ba5cd75631aa4621da1402e578b0239908c2268795b6cb449c8c4b41adf590426fc9e3c2b563
|
|
7
|
+
data.tar.gz: 4f68ba68ad0ee15585eff8150b87fc448931b3a2aab2aa55bc3aee7d6ca9800851fa46d94b6d20c27012e3f89829e19b979cbec8d993554039a7857f2e105468
|
data/CHANGELOG.md
CHANGED
data/lib/oj_serializers/setup.rb
CHANGED
|
@@ -4,10 +4,16 @@ require 'oj'
|
|
|
4
4
|
|
|
5
5
|
# NOTE: We automatically set the necessary configuration unless it had been
|
|
6
6
|
# explicitly set beforehand.
|
|
7
|
+
#
|
|
8
|
+
# `use_raw_json` must be enabled *before* `Oj.optimize_rails`. Rails 8.1
|
|
9
|
+
# memoizes an option-less encoder when the JSON encoder is assigned (which
|
|
10
|
+
# `Oj.optimize_rails` does), and `Oj::Rails::Encoder` captures `default_options`
|
|
11
|
+
# at construction. Enabling `use_raw_json` afterwards leaves that memoized
|
|
12
|
+
# encoder with `use_raw_json: false`, which double-encodes `JsonValue`.
|
|
7
13
|
unless Oj.default_options[:use_raw_json]
|
|
8
14
|
require 'rails'
|
|
9
|
-
Oj.optimize_rails
|
|
10
15
|
Oj.default_options = { mode: :rails, use_raw_json: true }
|
|
16
|
+
Oj.optimize_rails
|
|
11
17
|
end
|
|
12
18
|
|
|
13
19
|
# NOTE: Add an optimization to make it easier to work with a StringWriter
|