From c3bd7b57e359788b26674683fb5b1518c75f6bb1 Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Wed, 4 Jun 2014 06:43:30 -0600 Subject: Bring type casting behavior of hstore/json in line with serialized `@raw_attributes` should not contain the type-cast, mutable version of the value. --- activerecord/test/cases/adapters/postgresql/json_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activerecord/test/cases/adapters/postgresql/json_test.rb') 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" } -- cgit v1.2.3