Hi, I’ve got a feedback and comments model, with references between them.
But, when I attempt to destroy an individual comment or feedback, I get ERROR: update or delete on table … violates foreign key constraint.
I may have missed something in my models or what can I do to fix these 2 issues.
Have you set up dependent: [:destroy, :nullify, some other option] in your associations? If not, you will get this error, since you are trying to override a database constraint. It would be helpful if you posted just the relevant parts of your model code here, so we can suggest a solution. Like this: