You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to delete a permanent record, which has_many permanent records using record.destroy(:force), but I get stuck because referential integrity is violated by doing this.
I took a look at the specs, which try to verify that this works, but (I think) SQLite does not enforce referential integrity the way PostgreSQL does.
In the code I found this segment which seems to be the code at fault (should I be correct about my assumption).
The records in the has_many association are properly being saved in dependent_records, however, the block, in this case super() gets called before, meaning that before permanent_records has a chance to indeed delete the records that are permanent, my code crashes because super throws an exception before this can happen.