I have 2 models in my Ruby on Rails app : User and Freelance, with Freelance having a belongs_to User relationship.
When a user deletes their account, I destroy the User object but not the Freelance object, to keep data consistency in my app, so some Freelances have a nil user_id.
(for instance, some Freelances might have a conversation together and one deletes their account, I need to keep the deleted account’s freelance id to keep it all working).
Forest displays my Freelance collection fine, until I destroy a Freelance’s User. Then I get the “cannot reach your data” message, with this network result on fetch:
I can see in the “includes” array that the first User has a null id, which I guess is the cause of the error message.
I tried various things to “hide” the user field or ask Forest not to load it, but I couldn’t find anything to make it work. Can I reconfigure the user field to let it have a null relationship? Or even ask Forest not to load this particular field?
Forest shows the Freelance collection even with a destroyed belongs_to relationship.
I get the “Cannot reach your data” error message when trying to display the collection with an object having an empty belongs_to relationship.
- Package Version: forest_liana (6.1.1)
- Database Dialect: PostgreSQL
- Database Version: 12.4
- Project Name: ArtelinkAdmin