Created by: pedantic-git
This PR allows users to edit Field::Polymorphic
fields (previously they were just told this was not possible).
The <select>
is a grouped select, populated using the contents of zero-or-more model classes specified in the :classes
option.
I appreciate I haven't really added much in the way of testing for this, but I think it's comparable with the amount of testing the other complex built-in types already have (e.g. Field::HasMany
).
The one place in the core that's changed here and might be controversial, is that #resource_params
now auto-converts anything that looks like a GlobalID. This is necessary for a polymorphic field without JavaScript as GlobalIDs are the only IDs that work across multiple models. Let me know if you need this implementing a different way.