Repository URL to install this package:
|
Version:
0.9.0 ▾
|
| lib |
| spec |
| tasks |
| Gemfile |
| Gemfile.lock |
| LICENSE |
| README.md |
| Rakefile |
| VERSION |
| dm-pg-types.gemspec |
dm-pg-types is available as a RubyGem. Simply put this in your Gemfile
gem 'dm-pg-types'
and you should be good to go.
DataMapper plugin providing support for PostgreSQL's HSTORE and ARRAY types. An example will suffice
DataMapper.setup(:default, 'postgres://localhost/dm_pg_types_person') DataMapper.repository(:default).adapter.execute("DROP TABLE IF EXISTS people") DataMapper.repository(:default).adapter.execute("CREATE EXTENSION HSTORE") class Person include DataMapper::Resource property :id, Serial property :name, String property :info, HStore property :decimals, DecimalArray, :scale => 5, :precision => 10 end DataMapper.finalize DataMapper.auto_migrate! p = Person.new p.info = {:a => "b", :c => "d"} p.decimals = [10.1, 11.2] p.save
Thanks to https://github.com/softa/activerecord-postgres-hstore for doing most of the heavy lifting