From 0c8d9e1907cd671650f0af9e2782c81473b8950b Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Thu, 3 Mar 2016 02:22:04 +0100 Subject: [PATCH] delete aspect_visibilities when deleting the shareable --- lib/diaspora/shareable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/diaspora/shareable.rb b/lib/diaspora/shareable.rb index 2c6b1b6ce..a4c58ed86 100644 --- a/lib/diaspora/shareable.rb +++ b/lib/diaspora/shareable.rb @@ -8,7 +8,7 @@ module Diaspora module Shareable def self.included(model) model.instance_eval do - has_many :aspect_visibilities, as: :shareable, validate: false + has_many :aspect_visibilities, as: :shareable, validate: false, dependent: :delete_all has_many :aspects, through: :aspect_visibilities has_many :share_visibilities, as: :shareable, dependent: :delete_all