ohler55/oj — pull request #64 by rolftimmermans (2013-02-06 21:12:06+00:00)
Title: BigDecimal encoded differently in compat mode

In compat mode, BigDecimals are encoded as strings. In other modes, they are numbers. This is probably a mistake, because the correct code appears to be accidenatlly commented out in 7a573f2810dbd33ed163bde91b00bff333a328bb.

This PR reverts it and fixes the problem.

:::ruby
Oj.dump(BigDecimal.new("7"), mode: :strict)
=> 0.7E1
Oj.dump(BigDecimal.new("7"), mode: :object)
=> 0.7E1
Oj.dump(BigDecimal.new("7"), mode: :compat)
=> "0.7E1"