rails/rails — pull request #9160 by tawan (2013-02-02 22:16:14+00:00)
Title: Fix #9127, Extract PostgreSQL array column defaults more reliable.

As described in #9127 defaults of PostgreSQL columns of array types
are not extracted when the ARRAY constructor expression was used since
only the curly braces notation is expected.
This can lead to the confusing situation that new instances of
activerecord models don't prefill the relating attribute with the
default value as usual.

Nonetheless it is completely valid to define a default value for a
column with the ARRAY constructor expression. Since it is rather
complex to extract the default in this particular case by just scanning
with a ruby regular expression let the database itself convert from
the ARRAY constructor expression to the curly braces notation by
querying with a SELECT statement which will do the work reliable.