diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-14 18:55:10 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-14 18:55:10 -0300 |
commit | 57a952a223e10b1f4062f45a9490dc7076ea40ba (patch) | |
tree | a3d1b23752297c22e44862962b9340b8f1e40cf8 /activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | |
parent | 86af7d357899057f1565b2ebbeb4f3c3235846a1 (diff) | |
parent | 12e9a75f227ea7bcc23e2717e9ff5a72ec64e1f1 (diff) | |
download | rails-57a952a223e10b1f4062f45a9490dc7076ea40ba.tar.gz rails-57a952a223e10b1f4062f45a9490dc7076ea40ba.tar.bz2 rails-57a952a223e10b1f4062f45a9490dc7076ea40ba.zip |
Merge pull request #6713 from etehtsea/activerecord-uuid
Add uuid datatype support to PostgreSQL adapter
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 03c318f5f7..b08c59d97d 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -89,7 +89,6 @@ module ActiveRecord else string end - end def cidr_to_string(object) @@ -256,7 +255,7 @@ module ActiveRecord :integer # UUID type when 'uuid' - :string + :uuid # Small and big integer types when /^(?:small|big)int$/ :integer @@ -319,6 +318,10 @@ module ActiveRecord def macaddr(name, options = {}) column(name, 'macaddr', options) end + + def uuid(name, options = {}) + column(name, 'uuid', options) + end end ADAPTER_NAME = 'PostgreSQL' @@ -341,7 +344,8 @@ module ActiveRecord :hstore => { :name => "hstore" }, :inet => { :name => "inet" }, :cidr => { :name => "cidr" }, - :macaddr => { :name => "macaddr" } + :macaddr => { :name => "macaddr" }, + :uuid => { :name => "uuid" } } # Returns 'PostgreSQL' as adapter name for identification purposes. |