Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unarchive tries and fails to unarchive associated records with has_and_belongs_to_many relationship #59

Open
lbernick opened this issue Aug 21, 2024 · 0 comments

Comments

@lbernick
Copy link

Archive will only attempt to archive associated records with dependent: :destroy (here).

Unarchive, on the other hand, does not override association_conditions_met, so it tries to unarchive the associated records. This seems like a bug to me.

With a has_and_belongs_to_many relationship, act_on_association fails on this line with PG::UndefinedColumn: ERROR: column <table name of associated record>.<foreign key to thing being unarchived> does not exist. This is because the records are associated with each other in a separate join table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant