rails/rails — pull request #10619 by alno (2013-05-14 16:51:04+00:00)
Title: Support array as root element in JSON

For now json column support in Postgresql adapter is limited to writing structures which have a hash on the top.

So, for example, you may save {"a": [1,2,3]}, but not [{"a": 1}, {"a: 2}]. However, you may load both.

This patch adds support for saving json structures which have array element as root.

Also, if think, it may make sense to allow saving primitive values to json column (for now only numbers work), but it's blocked by strings, which for now are assigned as raw json values (and so changing it may break some existing code).