rails/rails — pull request #10214 by mattetti (2013-04-15 00:03:45+00:00)
Title: AR postgres binary bug fix

Currently, if a postgres table contains a record with a binary field and this record is fetched from the DB, an exception is raised if the binary data is nil.

This bug is due to the fact that the unescaping of the column value is passed directly to `PGConn` without checking for nil. `PGConn#unescape_bytea` does a check on the value type and raise an exception if the value isn't a string.

This PR adds tests around the binary type (currently no tests exist), and a fix for the mentioned bug.