diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-09-08 01:47:01 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-09-08 01:52:09 +0900 |
commit | a4b73f822ec96422e032b7d72c853e3c825859a6 (patch) | |
tree | b2840b36178e5ab5fa40d8cee19fdf4c508c3d70 /activerecord/test | |
parent | 0b31bed46e91b1482be72327d6770a33e935537c (diff) | |
download | rails-a4b73f822ec96422e032b7d72c853e3c825859a6.tar.gz rails-a4b73f822ec96422e032b7d72c853e3c825859a6.tar.bz2 rails-a4b73f822ec96422e032b7d72c853e3c825859a6.zip |
Fix `quote_default_expression` for UUID with array default
Fixes #30539.
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 76cb1bc354..8ba5132a8f 100644 --- a/activerecord/test/cases/adapters/postgresql/uuid_test.rb +++ b/activerecord/test/cases/adapters/postgresql/uuid_test.rb @@ -76,6 +76,16 @@ class PostgresqlUUIDTest < ActiveRecord::PostgreSQLTestCase assert_nil column.default end + def test_add_column_with_default_array + connection.add_column :uuid_data_type, :thingy, :uuid, array: true, default: [] + + UUIDType.reset_column_information + column = UUIDType.columns_hash["thingy"] + + assert column.array? + assert [], column.default + end + def test_data_type_of_uuid_types column = UUIDType.columns_hash["guid"] assert_equal :uuid, column.type |