Skip to content

Commit

Permalink
Furniture: Destroying a Furniture respects dependent: settings
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 <daltonrpruitt@users.noreply.github.com>
  • Loading branch information
zspencer and daltonrpruitt committed Jan 26, 2023
1 parent b86371b commit a08d11e
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 a08d11e

Please sign in to comment.