fuelen / ecto_erd

A mix task for generating Entity Relationship Diagram from Ecto schemas available in your project.
Apache License 2.0
216 stars 15 forks source link

Examples generator compilation error #1

Closed patatoid closed 3 years ago

patatoid commented 3 years ago

Thanks for the package, it helps a lot creating beautiful ERD diagrams, I was missing those these days :)

Using ecto_erd as a dependency has raised a compilation error in my setup.

Error while loading project :ecto_erd at /home/pascal/elixir/realworld/elixir-phoenix-realworld-example-app/deps/ecto_erd
** (Code.LoadError) could not load /home/pascal/elixir/realworld/elixir-phoenix-realworld-example-app/deps/ecto_erd/examples_generator.exs
    (elixir 1.12.1) lib/code.ex:1806: Code.find_file/2
    (elixir 1.12.1) lib/code.ex:1502: Code.compile_file/2
    /home/pascal/elixir/realworld/elixir-phoenix-realworld-example-app/deps/ecto_erd/mix.exs:1: (file)
    (elixir 1.12.1) lib/code.ex:1502: Code.compile_file/2

It appears that ExampleGenerator is not available for compilation here.

Maybe a workaround would be to compile the file at runtime while generating the docs as the module is needed only for documentation generation.

fuelen commented 3 years ago

Hey @patatoid

Thanks for pointing out. Fixed in https://github.com/fuelen/ecto_erd/commit/2ee76567056f5cc71e040846eb641c81e3e362e1