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

Provide meaningful error for circular references #303

Closed paulelliott closed 7 years ago

paulelliott commented 7 years ago

If you declare a circular reference in your fabricators today it can make for a bad time. It's difficult to figure out exactly where or how it happened because the error messages are not great.

We should detect this using fabrication's internal build stack and raise a meaningful error when it looks like it's happening. We can at least name the models involved and guide the user towards the fabricators causing the trouble.

This is in response to #269. We merged and released #270 as a fix but some users are experiencing difficulty with no workaround.