Skip to content

Commit

Permalink
Furniture: Destroying a Furniture respects dependent: settings (#1074)
Browse files Browse the repository at this point in the history
#709

When we were smoke-testing the Marketplace, I realized we had to destroy
and re-create the Marketplace, but the way we delete them was... uhhh
not respecting the (very prudent) foreign-keys we had added!

So now FurniturePlacements polymorph into their child implementation
prior to destruction, so that all `dependent: :destroy`  etc. actions
get carried out.

Co-authored-by: Dalton <[email protected]>
  • Loading branch information
zspencer and daltonrpruitt authored Jan 26, 2023
1 parent 2d2a22b commit 6fe3964
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/furniture_placements_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def update
end

def destroy
furniture_placement.destroy!
furniture_placement.furniture.destroy!
respond_to do |format|
format.html do
redirect_to(
Expand Down

0 comments on commit 6fe3964

Please sign in to comment.