diff options
| author | Yves Senn <yves.senn@gmail.com> | 2013-12-22 09:14:06 -0800 |
|---|---|---|
| committer | Yves Senn <yves.senn@gmail.com> | 2013-12-22 09:14:06 -0800 |
| commit | c0a6ffb799c2516f8ff76a9b4bf58b2ad1b9235b (patch) | |
| tree | 67b591620285f3cffa8fbb9a3e6e598baf45addc /activerecord/test | |
| parent | 7432d32f527f9a06ed51f576985987a1f87c5c78 (diff) | |
| parent | 1f6a9b50ee26d6c4520a416c66ef999d92570698 (diff) | |
| download | rails-c0a6ffb799c2516f8ff76a9b4bf58b2ad1b9235b.tar.gz rails-c0a6ffb799c2516f8ff76a9b4bf58b2ad1b9235b.tar.bz2 rails-c0a6ffb799c2516f8ff76a9b4bf58b2ad1b9235b.zip | |
Merge pull request #13451 from dmathieu/quoting_non_strings
Fix typecasting array of integers
Diffstat (limited to 'activerecord/test')
| -rw-r--r-- | activerecord/test/cases/adapters/postgresql/array_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/array_test.rb b/activerecord/test/cases/adapters/postgresql/array_test.rb index 06901a8990..114d5b6cc6 100644 --- a/activerecord/test/cases/adapters/postgresql/array_test.rb +++ b/activerecord/test/cases/adapters/postgresql/array_test.rb @@ -66,6 +66,12 @@ class PostgresqlArrayTest < ActiveRecord::TestCase assert_equal([nil], @column.type_cast('{NULL}')) end + def test_type_cast_integers + x = PgArray.new(ratings: ['1', '2']) + assert x.save! + assert_equal(['1', '2'], x.ratings) + end + def test_rewrite @connection.execute "insert into pg_arrays (tags) VALUES ('{1,2,3}')" x = PgArray.first |
