diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-08-06 20:19:44 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-08-06 20:19:44 +0200 |
commit | 179deea65b7c6dd6107dbe5930f91fa73e16ac1a (patch) | |
tree | 95f5d36c1567a38d0081d7e4e04b1b1772d8d3dc /activerecord | |
parent | b7f2ccd77ac6767b89908523cc4a4ee34fa9f145 (diff) | |
download | rails-179deea65b7c6dd6107dbe5930f91fa73e16ac1a.tar.gz rails-179deea65b7c6dd6107dbe5930f91fa73e16ac1a.tar.bz2 rails-179deea65b7c6dd6107dbe5930f91fa73e16ac1a.zip |
test to express that we can't turn non-array columns to array columns.
Closes #11062
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/array_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/array_test.rb b/activerecord/test/cases/adapters/postgresql/array_test.rb index e5e877f0b0..c537b08c3e 100644 --- a/activerecord/test/cases/adapters/postgresql/array_test.rb +++ b/activerecord/test/cases/adapters/postgresql/array_test.rb @@ -39,6 +39,15 @@ class PostgresqlArrayTest < ActiveRecord::TestCase assert column.array end + def test_change_column_cant_make_non_array_column_to_array + @connection.add_column :pg_arrays, :a_string, :string + assert_raises ActiveRecord::StatementInvalid do + @connection.transaction do + @connection.change_column :pg_arrays, :a_string, :string, array: true + end + end + end + def test_type_cast_array assert @column |