diff --git a/app/interactors/projects/destroy.rb b/app/interactors/projects/destroy.rb index 23dae1a8..8a35a4fe 100644 --- a/app/interactors/projects/destroy.rb +++ b/app/interactors/projects/destroy.rb @@ -2,10 +2,10 @@ module Projects class Destroy include Interactor - delegate :project, to: :context + delegate :project, :users, to: :context before do - context.users = project.users + context.users = User.where(id: project.users.pluck(:id)) end def call @@ -13,7 +13,7 @@ def call end after do - context.users.each do |user| + users.each do |user| ProjectMailer.project_destroyed(user).deliver_later end end