Skip to content

Commit

Permalink
fix fixtures indent
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffenDE committed Feb 20, 2025
1 parent b5e02d9 commit 01cfe52
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions priv/templates/phx.gen.context/fixtures.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<% end %> @doc """
Generate a <%= schema.singular %>.
"""
def <%= schema.singular %>_fixture(<%= if scope do %>scope, <% end %>attrs \\ %{}) do
<%= if scope do %>attrs = Enum.into(attrs, %{
<%= schema.fixture_params |> Enum.map(fn {key, code} -> " #{key}: #{code}" end) |> Enum.join(",\n") %>
})
def <%= schema.singular %>_fixture(<%= if scope do %>scope, <% end %>attrs \\ %{}) do<%= if scope do %>
attrs =
Enum.into(attrs, %{
<%= schema.fixture_params |> Enum.map(fn {key, code} -> " #{key}: #{code}" end) |> Enum.join(",\n") %>
})

{:ok, <%= schema.singular %>} = <%= inspect context.module %>.create_<%= schema.singular %>(scope, attrs)
<% else %>{:ok, <%= schema.singular %>} =
{:ok, <%= schema.singular %>} = <%= inspect context.module %>.create_<%= schema.singular %>(scope, attrs)<% else %>{:ok, <%= schema.singular %>} =
attrs
|> Enum.into(%{
<%= schema.fixture_params |> Enum.map(fn {key, code} -> " #{key}: #{code}" end) |> Enum.join(",\n") %>
Expand Down

0 comments on commit 01cfe52

Please sign in to comment.