Handling HABTM associations? #27

Closed
cwade opened this Issue Mar 25, 2011 · 1 comment

1 participant

@cwade

First of all, thanks for this gem. I like the idea behind it and it's working great.

The only thing I haven't been able to figure out is how to handle many-to-many relationships. I have a Reservation class that has_and_belongs_to_many EquipmentPieces.

When a reservation is archived, I want to also archive the corresponding entries in the equipment_pieces_reservations table, but I haven't been able to figure out how to do this.

Thanks again.

@cwade

Never mind - I figured it out. I can create a EquipmentPiecesReservation class that inherits from ActiveRecord::Base and then add that class to my acts_as_archive.yml file. Works like a charm - thanks!

@cwade cwade closed this Mar 25, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment