discourse/config/initializers/100-oj.rb
Sam Saffron f8e92298f2 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.
2020-01-16 07:52:28 +11:00

10 lines
232 B
Ruby

# frozen_string_literal: true
Oj::Rails.set_encoder()
Oj::Rails.set_decoder()
Oj::Rails.optimize()
Oj.default_options = Oj.default_options.merge(mode: :compat)
# Not sure why it's not using this by default!
MultiJson.engine = :oj