diff options
author | Tadas Tamosauskas <tadas@pdfcv.com> | 2013-09-28 16:10:59 +0100 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-12-23 16:27:54 -0200 |
commit | 73bba4c1e1f7fa23aa1a126971338d94ae42398f (patch) | |
tree | 27ac306d20b5f6216e838314025f7218633dfdea /activerecord/test/cases/adapters/postgresql/array_test.rb | |
parent | 56510091fb8d178ec7c2391bed9fbdb9e3a54287 (diff) | |
download | rails-73bba4c1e1f7fa23aa1a126971338d94ae42398f.tar.gz rails-73bba4c1e1f7fa23aa1a126971338d94ae42398f.tar.bz2 rails-73bba4c1e1f7fa23aa1a126971338d94ae42398f.zip |
Serialize postgres' hstore, json and array types correctly in AR update methods.
Fixes #12261. Closes #12395.
Conflicts:
activerecord/CHANGELOG.md
activerecord/test/cases/adapters/postgresql/array_test.rb
activerecord/test/cases/adapters/postgresql/json_test.rb
Diffstat (limited to 'activerecord/test/cases/adapters/postgresql/array_test.rb')
-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 b0870e2256..cf059d20e2 100644 --- a/activerecord/test/cases/adapters/postgresql/array_test.rb +++ b/activerecord/test/cases/adapters/postgresql/array_test.rb @@ -128,6 +128,12 @@ class PostgresqlArrayTest < ActiveRecord::TestCase assert_equal("[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...]", record.attribute_for_inspect(:ratings)) end + def test_update_all + PgArray.create! tags: ["one", "two", "three"] + PgArray.update_all tags: ["four", "five"] + assert_equal ["four", "five"], PgArray.first.tags + end + private def assert_cycle field, array # test creation |