mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 10:03:43 +08:00
f8e92298f2
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.
10 lines
232 B
Ruby
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
|