Created by: gracewashere
Problem:
Until now, polymorphic relationships were being treated as standard belongs_to
relationships. When Administrate inferred the incorrect class name for models, it resulted in a 500 error. This was most commonly seen on the form page.
In addition, when a polymorphic relationship has a non-existant class, the dashboard was throwing errors. This was the case on Upcase, where there are several dangling references from the Classification
model to the removed Article
model.
More information on https://trello.com/c/dMUeObDx
Solution:
- Detect polymorphic belongs_to relationships in the dashboard generator
- Add
Administrate::Field::PolymorphicBelongsTo
- Rescue errors when associated object lookup fails
- Add a stopgap "not supported" message to polymorphic forms for the moment. Trello card for completing it: https://trello.com/c/D9qnFx10
Related:
- Update Changelog
Tags: #ruby