fix(Relationship): do not set static_record_type for polymorphic relationships (#82)

This commit is contained in:
Kevin Pheasey 2020-05-18 10:09:58 -04:00 committed by GitHub
parent ac34aa22f7
commit 1d2eab2510
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [unreleased]
### Fixed
- Relationship#record_type_for does not assign static record type for polymorphic relationships (#83)
## [1.7.1] - 2020-05-01
### Fixed
- ObjectSerializer#serialized_json accepts arguments for to_json (#80)

View File

@ -212,8 +212,13 @@ module FastJsonapi
end
def compute_static_record_type
return run_key_transform(record_type) if record_type
return run_key_transform(@static_serializer.record_type) if @static_serializer
if polymorphic
nil
elsif record_type
run_key_transform(record_type)
elsif @static_serializer
run_key_transform(@static_serializer.record_type)
end
end
end
end