diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-06-06 14:11:54 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-06-06 14:11:54 +0200 |
commit | 485dab41c4ff7de392ffba132fbcbff49e6fe9ef (patch) | |
tree | f28e2819a4d2c8d195ea3807acafe2369ef8421d /activerecord/test/cases/adapters/postgresql/json_test.rb | |
parent | 8d77436f374acf06b46d1e0615b364ebd8acae8d (diff) | |
parent | c3bd7b57e359788b26674683fb5b1518c75f6bb1 (diff) | |
download | rails-485dab41c4ff7de392ffba132fbcbff49e6fe9ef.tar.gz rails-485dab41c4ff7de392ffba132fbcbff49e6fe9ef.tar.bz2 rails-485dab41c4ff7de392ffba132fbcbff49e6fe9ef.zip |
Merge pull request #15503 from sgrif/sg-json-hstore-storage
Bring type casting behavior of hstore/json in line with serialized
Diffstat (limited to 'activerecord/test/cases/adapters/postgresql/json_test.rb')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/json_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/json_test.rb b/activerecord/test/cases/adapters/postgresql/json_test.rb index 03b546119d..61d4e2b8ae 100644 --- a/activerecord/test/cases/adapters/postgresql/json_test.rb +++ b/activerecord/test/cases/adapters/postgresql/json_test.rb @@ -147,6 +147,14 @@ class PostgresqlJSONTest < ActiveRecord::TestCase assert_equal "320×480", y.resolution end + def test_yaml_round_trip_with_store_accessors + x = JsonDataType.new(resolution: "320×480") + assert_equal "320×480", x.resolution + + y = YAML.load(YAML.dump(x)) + assert_equal "320×480", y.resolution + end + def test_update_all json = JsonDataType.create! payload: { "one" => "two" } |