jruby/activerecord-jdbc-adapter — pull request #491 by jcxplorer (2013-11-05 17:47:11+00:00)
Title: PostgreSQL: Add support for array as root element in JSON

Currently when trying to store an array in a JSON column, the array is serialized as YAML, which results in:

```
ActiveRecord::StatementInvalid: ActiveRecord::JDBCError: org.postgresql.util.PSQLException: ERROR: invalid input syntax for type json
Detail: Token "-" is invalid.
Position: 30
Where: JSON data, line 1: -...: UPDATE "things" SET "data" = '---
```

This fix is ported from ActiveRecord 4.0.1 (https://github.com/rails/rails/commit/9b66187622453679497ad2fed4f333e2fca32150).