Skip to content

Commit

Permalink
Move defp to the end
Browse files Browse the repository at this point in the history
  • Loading branch information
macobo committed Jun 28, 2024
1 parent 97207e4 commit 48aef7e
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/plausible/stats/sql/fragments.ex
Original file line number Diff line number Diff line change
Expand Up @@ -156,18 +156,6 @@ defmodule Plausible.Stats.SQL.Fragments do
def meta_value_column(:meta), do: :"meta.value"
def meta_value_column(:entry_meta), do: :"entry_meta.value"

defp update_literal_map_values({:%{}, ctx, keyword_list}, mapper_fn) do
{
:%{},
ctx,
Enum.map(keyword_list, fn {key, expr} ->
{key, mapper_fn.({key, expr})}
end)
}
end

defp update_literal_map_values(ast, _), do: ast

@doc """
Convenience Ecto macro for wrapping a map passed to select_merge_as such that each
expression gets wrapped in dynamic and set as selected_as.
Expand Down Expand Up @@ -203,4 +191,16 @@ defmodule Plausible.Stats.SQL.Fragments do
select_merge(unquote(q), [], ^wrap_expression(unquote(binding), unquote(map_literal)))
end
end

defp update_literal_map_values({:%{}, ctx, keyword_list}, mapper_fn) do
{
:%{},
ctx,
Enum.map(keyword_list, fn {key, expr} ->
{key, mapper_fn.({key, expr})}
end)
}
end

defp update_literal_map_values(ast, _), do: ast
end

0 comments on commit 48aef7e

Please sign in to comment.