From f7c8f2a69d88c517f30824046f2199c2260863ce Mon Sep 17 00:00:00 2001 From: Alan Vardy Date: Wed, 18 Dec 2024 17:26:18 -0800 Subject: [PATCH] Update Phoenix Liveview --- lib/exzeitable/database.ex | 5 +++-- lib/exzeitable/html/format.ex | 2 -- lib/test_web.ex | 6 +++--- lib/test_web/gettext.ex | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/exzeitable/database.ex b/lib/exzeitable/database.ex index 0256466b..dac70c10 100644 --- a/lib/exzeitable/database.ex +++ b/lib/exzeitable/database.ex @@ -56,8 +56,9 @@ defmodule Exzeitable.Database do query end - defp modify_query(query, %Params{query_modifier: {mod, fun}} = params) when is_atom(mod) and is_atom(fun) do - apply(mod, fun, [query, params]) + defp modify_query(query, %Params{query_modifier: {mod, fun}} = params) + when is_atom(mod) and is_atom(fun) do + apply(mod, fun, [query, params]) end defp modify_query(_query, %Params{query_modifier: invalid}) do diff --git a/lib/exzeitable/html/format.ex b/lib/exzeitable/html/format.ex index 78c217ee..654f2b20 100644 --- a/lib/exzeitable/html/format.ex +++ b/lib/exzeitable/html/format.ex @@ -27,8 +27,6 @@ defmodule Exzeitable.HTML.Format do |> format_field(fields[key].formatter) end - # coveralls-ignore-stop - @doc "Will output the user supplied label or fall back on the atom" @spec header(Params.t(), {atom, map}) :: String.t() def header(_params, {_key, %{label: label}}) when is_binary(label), do: label diff --git a/lib/test_web.ex b/lib/test_web.ex index dc83e2d1..f4408fd3 100644 --- a/lib/test_web.ex +++ b/lib/test_web.ex @@ -20,9 +20,9 @@ defmodule TestWeb do def controller do quote do use Phoenix.Controller, namespace: TestWeb + use Gettext, backend: TestWeb.Gettext import Plug.Conn - import TestWeb.Gettext alias TestWeb.Router.Helpers, as: Routes import Phoenix.LiveView.Controller end @@ -41,9 +41,9 @@ defmodule TestWeb do import Phoenix.HTML import Phoenix.HTML.Form use PhoenixHTMLHelpers + use Gettext, backend: TestWeb.Gettext import TestWeb.ErrorHelpers - import TestWeb.Gettext alias TestWeb.Router.Helpers, as: Routes import Phoenix.LiveView.Helpers @@ -62,7 +62,7 @@ defmodule TestWeb do def channel do quote do use Phoenix.Channel - import TestWeb.Gettext + use Gettext, backend: TestWeb.Gettext end end diff --git a/lib/test_web/gettext.ex b/lib/test_web/gettext.ex index d4a497aa..871fcdb7 100644 --- a/lib/test_web/gettext.ex +++ b/lib/test_web/gettext.ex @@ -20,5 +20,5 @@ defmodule TestWeb.Gettext do See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage. """ - use Gettext, otp_app: :exzeitable + use Gettext.Backend, otp_app: :exzeitable end