作者:mobiledu2502920277 | 来源:互联网 | 2023-10-10 13:04
Singularizing polymorphic association types allows you to use plural or singular
type values in your requests as allowed by JSON API.
Because ActiveRecord calls #constantize on the polymorphic association type
when you use the hash to create a new model, you must capitalize the type to
avoid a NameError.
该提问来源于开源项目:rails-api/active_model_serializers
I'm reading the comments above and looks like the PR didn't get finished by anyone. Unless wants to pick it up again, it'll need to be reworked against master, and also related #1928 cc