Skip to content

Commit

Permalink
Re-simplify get_revenue_tracking_currency
Browse files Browse the repository at this point in the history
  • Loading branch information
macobo committed Jun 27, 2024
1 parent 3d8fd1f commit 2638495
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions extra/lib/plausible/stats/goal/revenue.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ defmodule Plausible.Stats.Goal.Revenue do
)
end

@spec get_revenue_tracking_currency(Plausible.Site.t() | nil, Plausible.Stats.Query.t(), [
atom()
]) ::
@spec get_revenue_tracking_currency(Plausible.Site.t(), Plausible.Stats.Query.t(), [atom()]) ::
{atom() | nil, [atom()]}
@doc """
Returns the common currency for the goal filters in a query. If there are no
Expand All @@ -60,7 +58,7 @@ defmodule Plausible.Stats.Goal.Revenue do
Plausible.Billing.Feature.RevenueGoals.check_availability(site.owner) == :ok
end

if site && requested_revenue_metrics? && filtering_by_goal? && revenue_goals_available?.() do
if requested_revenue_metrics? && filtering_by_goal? && revenue_goals_available?.() do
revenue_goals_currencies =
Plausible.Repo.all(
from rg in Ecto.assoc(site, :revenue_goals),
Expand Down

0 comments on commit 2638495

Please sign in to comment.