refactor: reduce nesting depth and improve code readability

- Replace Enum.map |> Enum.join with Enum.map_join for efficiency
- Extract helper functions to reduce nesting depth from 4 to 2
- Rename is_current_cycle? to current_cycle? following Elixir conventions
This commit is contained in:
Moritz 2025-12-15 11:50:08 +01:00
parent 2d1d650c28
commit 4384086245
Signed by: moritz
GPG key ID: 1020A035E5DD0824
3 changed files with 146 additions and 114 deletions

View file

@ -215,8 +215,7 @@ defmodule Mv.MembershipFees.Changes.ValidateSameIntervalTest do
defp extract_error_message(%Ash.Error.Invalid{errors: errors}) do
errors
|> Enum.filter(&(&1.field == :membership_fee_type_id))
|> Enum.map(& &1.message)
|> Enum.join(" ")
|> Enum.map_join(" ", & &1.message)
end
end
end