diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-05-29 22:08:20 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-29 22:08:20 -0400 |
commit | 0aa6bcdf612aa05e422f1f55278bab49a7a9153e (patch) | |
tree | 9269d094f955833f4bddce2ef0ca03815c6a52af /activerecord/test | |
parent | a5faf2df7a2dec74df575f23db417cc323f4bbe2 (diff) | |
parent | a0d17760bbc6254e0231a42300c842501aca080e (diff) | |
download | rails-0aa6bcdf612aa05e422f1f55278bab49a7a9153e.tar.gz rails-0aa6bcdf612aa05e422f1f55278bab49a7a9153e.tar.bz2 rails-0aa6bcdf612aa05e422f1f55278bab49a7a9153e.zip |
Merge pull request #29278 from kamipo/fix_uuid_column_with_null_true_and_default_nil
Fix UUID column with `null: true` and `default: nil`
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/uuid_test.rb | 10 |
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 52e4a38cae..6ebe9d82a7 100644 --- a/activerecord/test/cases/adapters/postgresql/uuid_test.rb +++ b/activerecord/test/cases/adapters/postgresql/uuid_test.rb @@ -63,6 +63,16 @@ class PostgresqlUUIDTest < ActiveRecord::PostgreSQLTestCase UUIDType.reset_column_information end + def test_add_column_with_null_true_and_default_nil + assert_nothing_raised do + connection.add_column :uuid_data_type, :thingy, :uuid, null: true, default: nil + end + UUIDType.reset_column_information + column = UUIDType.columns_hash["thingy"] + assert column.null + assert_nil column.default + end + def test_data_type_of_uuid_types column = UUIDType.columns_hash["guid"] assert_equal :uuid, column.type |