Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ecto/Phoenix aren't optional #14

Open
jodyrodd opened this issue Aug 21, 2019 · 2 comments
Open

Ecto/Phoenix aren't optional #14

jodyrodd opened this issue Aug 21, 2019 · 2 comments

Comments

@jodyrodd
Copy link

The Ecto dependency in the mix file is listed as optional:
https://github.com/romul/newrelic.ex/blob/master/mix.exs#L27

      {:ecto, ">= 2.0.0", optional: true},

However, it isn't. It is being explicitly referenced here: https://github.com/romul/newrelic.ex/blob/master/lib/new_relic/plug/instrumentation.ex#L44

 defp infer_model(%{__struct__: model_type, __meta__: %Ecto.Schema.Metadata{}}) do
    model_name(model_type)
  end

and other places in the file.

Without explicitly including Ecto, the project won't compile. Is this intentional? I'd rather not include Ecto in my project if I don't have to.

@sb8244
Copy link
Collaborator

sb8244 commented Aug 21, 2019

Thanks @jodyrodd. That would be a compile error. I think it could be fixed by checking the schema key at runtime, or by discarding the schema check altogether. I will investigate how it's being used.

@jodyrodd jodyrodd changed the title Ecto isn't optional Ecto/Phoenix aren't optional Aug 21, 2019
@jodyrodd
Copy link
Author

The optional phoenix include is also not optional and generates compile errors on projects that don't use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants