aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql/uuid_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-03-22 19:30:24 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-03-22 19:30:24 -0700
commitbc8ebefe9825dbff2cffa29ff015a1e7a31f9812 (patch)
tree436286dc1d634aa35531a065821c3351a6cf237f /activerecord/test/cases/adapters/postgresql/uuid_test.rb
parentd25e4076ba2061baf7b96784c9b4df4256ce736e (diff)
downloadrails-bc8ebefe9825dbff2cffa29ff015a1e7a31f9812.tar.gz
rails-bc8ebefe9825dbff2cffa29ff015a1e7a31f9812.tar.bz2
rails-bc8ebefe9825dbff2cffa29ff015a1e7a31f9812.zip
add uuid primary key support
Diffstat (limited to 'activerecord/test/cases/adapters/postgresql/uuid_test.rb')
-rw-r--r--activerecord/test/cases/adapters/postgresql/uuid_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/uuid_test.rb b/activerecord/test/cases/adapters/postgresql/uuid_test.rb
index 53002c5265..c0c0e8898c 100644
--- a/activerecord/test/cases/adapters/postgresql/uuid_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/uuid_test.rb
@@ -35,6 +35,16 @@ class PostgresqlUUIDTest < ActiveRecord::TestCase
@connection.execute 'drop table if exists pg_uuids'
end
+ def test_id_is_uuid
+ assert_equal :uuid, UUID.columns_hash['id'].type
+ assert UUID.primary_key
+ end
+
+ def test_id_has_a_default
+ u = UUID.create
+ assert_not_nil u.id
+ end
+
def test_auto_create_uuid
u = UUID.create
u.reload