Fix deserialization of polymorphic relationships (#2200)

* Classify the relationship type for polymorphic associations
This commit is contained in:
Dennis Stumm
2017-10-08 00:03:38 +02:00
committed by Benjamin Fleischer
parent 715a702f55
commit 4d7c2457d7
4 changed files with 4 additions and 3 deletions

View File

@@ -45,7 +45,7 @@ module ActionController
response = JSON.parse(@response.body)
expected = {
'restriction_for_id' => '67',
'restriction_for_type' => 'discounts',
'restriction_for_type' => 'Discount',
'restricted_to_id' => nil,
'restricted_to_type' => nil
}

View File

@@ -125,7 +125,7 @@ module ActiveModelSerializers
src: 'http://example.com/images/productivity.png',
author_id: nil,
photographer_id: '9',
photographer_type: 'people',
photographer_type: 'Person',
comment_ids: %w(1 2)
}
assert_equal(expected, parsed_hash)