Skip to content

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

@lbernick

Description

@lbernick

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions