paulelliott / fabrication

This project has moved to GitLab! Please check there for the latest updates.
https://gitlab.com/fabrication-gem/fabrication
MIT License
998 stars 97 forks source link

Fix a regression regarding polymorphic belongs_to relationships #298

Closed paulelliott closed 7 years ago

paulelliott commented 7 years ago

Fixes #295

paulelliott commented 7 years ago

Sorry this has been taking so long. I've been thinking quite a bit about the best way to address this. I also have concerns about the performance hit from inspecting these relationships all the time. I feel like the complexity of this code and any potential fixes combined with the possibly confusing user experience of rewriting fields just isn't worth it.

The spirit of #270 was to prevent infinite loops within fabricators, which is a worthwhile goal. I think there is an alternate approach though where we watch the build stack for loops and throw a meaningful error when one is detected.

I'm going to merge this PR and cut a release, then open an issue describing the alternate behavior.