defmodule MyApp.Establishments.Invitation.Calculations.Url do
use Ash.Resource.Calculation
@impl true
def load(_query, _opts, _context), do: [:id]
@impl true
def calculate(records, _opts, _context) do
Enum.map(records, fn record ->
# Calling this function caused this module (url.ex) to end up with 39 runtime dependencies
LamashkaWeb.Endpoint.url() <> "/accept-invitation/#{record.id}"
end)
end
end
defmodule MyApp.Establishments.Invitation.Calculations.Url do
use Ash.Resource.Calculation
@impl true
def load(_query, _opts, _context), do: [:id]
@impl true
def calculate(records, _opts, _context) do
Enum.map(records, fn record ->
# Calling this function caused this module (url.ex) to end up with 39 runtime dependencies
LamashkaWeb.Endpoint.url() <> "/accept-invitation/#{record.id}"
end)
end
end