Adds support for missing PostgreSQL data types to ActiveRecord.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install postgres_ext
require 'postgres_ext' and use ActiveRecord as you normally would! postgres_ext extends
ActiveRecord's data type handling.
Avoid the use of in place operators (ie
Array#<<). These changes are
not tracked by Rails (this issue)
explains why). In place modifications also modify the default object.
Assuming we have the following model:
create_table :items do |t| t.string :names, :array => true, :default =>  end class Item < ActiveRecord::Base end
The following will modify the default value of the names attribute.
a = Item.new a.names << 'foo' b = Item.new puts b.names # => ['foo']
The supported way of modifying
a = Item.new a.names += ['foo'] b = Item.new puts b.names # => 
As a result, in place operators are discouraged and will not be supported in postgres_ext at this time.