diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-01-04 13:27:33 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-01-04 13:27:33 -0800 |
commit | fba6a6a2d9137fb22cc8e6ca4d82a05dd9ba2cce (patch) | |
tree | 4b81505089af848226931d13e5283bda7e4bd00d /activerecord/lib | |
parent | cfb3019a1a7d699282a650b68cba7201b5e9f379 (diff) | |
parent | e209107a518c70c24d3d05ce246b8a79de9c7632 (diff) | |
download | rails-fba6a6a2d9137fb22cc8e6ca4d82a05dd9ba2cce.tar.gz rails-fba6a6a2d9137fb22cc8e6ca4d82a05dd9ba2cce.tar.bz2 rails-fba6a6a2d9137fb22cc8e6ca4d82a05dd9ba2cce.zip |
Merge pull request #8755 from robworley/postgresql-ltree-data-type
Support for PostgreSQL's ltree datatype
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/oid.rb | 1 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/oid.rb b/activerecord/lib/active_record/connection_adapters/postgresql/oid.rb index 0a69e062f0..02c295983f 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/oid.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid.rb @@ -276,6 +276,7 @@ module ActiveRecord register_type 'circle', OID::Identity.new register_type 'hstore', OID::Hstore.new register_type 'json', OID::Json.new + register_type 'ltree', OID::Identity.new register_type 'int4range', OID::IntRange.new alias_type 'int8range', 'int4range' diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index d62a375470..c106215bd5 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -173,6 +173,8 @@ module ActiveRecord :decimal when 'hstore' :hstore + when 'ltree' + :ltree # Network address types when 'inet' :inet @@ -275,6 +277,10 @@ module ActiveRecord column(name, 'hstore', options) end + def ltree(name, options = {}) + column(name, 'ltree', options) + end + def inet(name, options = {}) column(name, 'inet', options) end @@ -340,7 +346,8 @@ module ActiveRecord macaddr: { name: "macaddr" }, uuid: { name: "uuid" }, json: { name: "json" }, - intrange: { name: "int4range" } + intrange: { name: "int4range" }, + ltree: { name: "ltree" } } include Quoting |