Commit dddb863
authored
Drop multi_json dependency and fix Time serialization regression (#404)
Switching from MultiJson.dump to the standard JSON library in a prior
release broke Time serialization for apps using ActiveSupport: Time
values were no longer encoded as ISO 8601 strings because the standard
JSON backend does not invoke ActiveSupport's as_json chain.
Replace MultiJson.dump(serializable_hash(...)) with
serializable_hash(...).to_json so that ActiveSupport's to_json
extension is invoked, restoring ISO 8601 output (e.g.
"2012-02-27T00:00:00.000Z") for Time and other ActiveSupport-enhanced
types. Remove the multi_json runtime dependency from the gemspec as it
is no longer used.
Regression specs assert the exact ISO 8601 string rather than
delegating the expectation to as_json on the same value, so a joint
regression in both methods would still be caught.1 parent a4e3fcd commit dddb863
4 files changed
Lines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
| |||
594 | 592 | | |
595 | 593 | | |
596 | 594 | | |
597 | | - | |
| 595 | + | |
598 | 596 | | |
599 | 597 | | |
600 | 598 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1886 | 1886 | | |
1887 | 1887 | | |
1888 | 1888 | | |
1889 | | - | |
| 1889 | + | |
1890 | 1890 | | |
1891 | 1891 | | |
1892 | 1892 | | |
| |||
1895 | 1895 | | |
1896 | 1896 | | |
1897 | 1897 | | |
1898 | | - | |
| 1898 | + | |
1899 | 1899 | | |
1900 | 1900 | | |
1901 | 1901 | | |
| |||
0 commit comments