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 have Stadium and StadiumUser models, and the dependency between them is like that:
class StadiumUser < User
....
has_one :stadium, foreign_key: "user_id", dependent: :destroy, required: true
after_create :make_stadium
end
I created the StadiumUser (Stadium is created with it)
I deleted StadiumUser via rails_admin
I find the Stadium deletion entry and press "Restore"
this error appears
PG::ForeignKeyViolation at /stadium/history
ERROR: insert or update on table "stadiums" violates foreign key constraint "fk_rails_b1bd5d1cc5"
DETAIL: Key (user_id)=(56) is not present in table "users".
The text was updated successfully, but these errors were encountered:
I can't check it for now, but it shouldn't work either, since no has_one: true param is specified when using paper_trail's reify.
Anyway, will check it out later.
Related: paper-trail-gem/paper_trail#841
How to reproduce:
The text was updated successfully, but these errors were encountered: