rails/rails — pull request #7547 by danmcclain (2012-09-06 18:35:47+00:00)
Title: Adds migration and type casting support for PostgreSQL Array datatype

PostgreSQL array type support. Any datatype can be used to create an array column, with full migration and schema dumper support.

To declare an array column, use the following syntax:

```ruby
create_table :table_with_arrays do |t|
t.integer :int_array, :array => true
# integer[]
t.integer :int_array, :array => true, :length => 2
# smallint[]
t.string :string_array, :array => true, :length => 30
# char varying(30)[]
end
```

This respects any other migraion detail (limits, defaults, etc). ActiveRecord will serialize and deserialize the array columns on their way to and from the database.

One thing to note: PostgreSQL does not enforce any limits on the number of elements, and any array can be multi-dimensional. Any array that is multi-dimensional must be rectangular (each sub array must have the same number of elements as its siblings).

I can squash this commit after review