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:
parent
2d1d650c28
commit
4384086245
3 changed files with 146 additions and 114 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue