I added a .formatter.exs file on the root level and ran Elixir mix format on the codebase. Additionally Ecto 3 has the breaking change as below:
[Ecto.Schema.Metadata] The source key no longer returns a tuple of the schema_prefix and the table/collection name. It now returns just the table/collection string. You can now access the schema_prefix via the prefix key.
Therefore I added a check on lib/tree.ex on the return type of struct_fields[:__meta__].source and assign accordingly. My original idea is to check the Ecto version (using Application.spec(:ecto, :vsn)) on lib/tree.ex instead but I couldn't get the test cases to pass as on the test cases Ecto wasn't really "loaded".
I added a
.formatter.exs
file on the root level and ran Elixirmix format
on the codebase. Additionally Ecto 3 has the breaking change as below:[Ecto.Schema.Metadata] The source key no longer returns a tuple of the schema_prefix and the table/collection name. It now returns just the table/collection string. You can now access the schema_prefix via the prefix key.
Therefore I added a check on
lib/tree.ex
on the return type ofstruct_fields[:__meta__].source
and assign accordingly. My original idea is to check the Ecto version (usingApplication.spec(:ecto, :vsn)
) onlib/tree.ex
instead but I couldn't get the test cases to pass as on the test cases Ecto wasn't really "loaded".Would appreciate any comments on the PR.