From 1dab37ed588e4e5b5fffd0efbb1fea556ae2bd3a Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Fri, 29 Nov 2019 00:05:20 -0500 Subject: [PATCH] create auto subscription on image upload --- lib/philomena/images.ex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/philomena/images.ex b/lib/philomena/images.ex index 358f0772..2eb12e4b 100644 --- a/lib/philomena/images.ex +++ b/lib/philomena/images.ex @@ -69,6 +69,9 @@ defmodule Philomena.Images do {:ok, count} end) + |> Multi.run(:subscribe, fn _repo, %{image: image} -> + create_subscription(image, attribution[:user]) + end) |> Multi.run(:after, fn _repo, %{image: image} -> Processors.after_insert(image)