Skip to content

Commit

Permalink
FIX: no error when assigned post is deleted (#244)
Browse files Browse the repository at this point in the history
When an assigned post is deleted, we should not error. For now, assignment object is left untouched to not lose information when post is `undeleted`.

We can change that behaviour later if we decide that assignments should be deleted as well.
  • Loading branch information
lis2 committed Nov 15, 2021
1 parent 6354215 commit 677d6a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin.rb
Expand Up @@ -425,7 +425,7 @@ class ::ListController
add_to_class(:topic, :indirectly_assigned_to) do
return @indirectly_assigned_to if defined?(@indirectly_assigned_to)
@indirectly_assigned_to = Assignment.where(topic_id: id, target_type: "Post").inject({}) do |acc, assignment|
acc[assignment.target.post_number] = assignment.assigned_to
acc[assignment.target.post_number] = assignment.assigned_to if assignment.target
acc
end
end
Expand Down

0 comments on commit 677d6a9

Please sign in to comment.