Deleting a building does not appear to delete rooms within that building
Steps to replicate:
- Create a building that contains at least one suite with at least one room
- Delete that building
Expected: All records (building, suite(s), room(s)) are deleted
Actual: Only the building and suite(s) are deleted
This is due to the fact that when we wrote suite merging (#179 (closed)) there were issues with rooms being destroyed when the old suites were destroyed (see c3d97c1e). To resolve this issue, we want to change the association in app/models/suite.rb
to has_many :rooms, dependent: :destroy
and making sure that suite merging still works.
Edited by Oren Kanner