Dynflow/dynflow — pull request #127 by iNecas (2014-08-14 20:26:23+00:00)
Title: Ensure deserialization from json keeps numeric values

After Oj 2.10.0, there happens quite often that the float is deserialized to
BigDecimal which is serialized back to string.

MultiJson.load(MultiJson.dump(
MultiJson.load(MultiJson.dump(6.903916489999999))))
# => "6.903916489999999"

Also, other JSON implementations have similar behavior when it takes
BigDecimal. More details here https://github.com/ohler55/oj/pull/59.

As preserving of the float type is not guaranteed, we need to manually
typecast to_f to avoid

Value (String) '3.00232023232032203232' is not any of: Numeric; NilClass