mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-02 08:13:47 +08:00
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.
9 lines
232 B
Ruby
9 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
|