DEV: default Oj to compat mode

Out-of-the-box Oj uses :object mode, this shifts us to use :compat mode
by default which is safer.
It means any de-serialization going forward will default to this mode.

If we wish to serialize or deserialize arbitrary objects going forward with
no json interfaces we will have to opt in.
This commit is contained in:
Sam Saffron 2020-01-16 07:52:28 +11:00
parent 0bc65fa60e
commit f8e92298f2

View File

@ -3,6 +3,7 @@
Oj::Rails.set_encoder() Oj::Rails.set_encoder()
Oj::Rails.set_decoder() Oj::Rails.set_decoder()
Oj::Rails.optimize() Oj::Rails.optimize()
Oj.default_options = Oj.default_options.merge(mode: :compat)
# Not sure why it's not using this by default! # Not sure why it's not using this by default!
MultiJson.engine = :oj MultiJson.engine = :oj