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

Cloak.Ecto.Type does not conform to the Ecto.Type behavior #12

Closed
WilHall opened this issue Oct 8, 2020 · 3 comments
Closed

Cloak.Ecto.Type does not conform to the Ecto.Type behavior #12

WilHall opened this issue Oct 8, 2020 · 3 comments

Comments

@WilHall
Copy link

WilHall commented Oct 8, 2020

The Cloak.Ecto.Type module does not conform to the Ecto.Type behavior. For example, equal/3 is not implemented.

Because of this, following the cloak_ecto usage instructions results in a custom Ecto type which does not conform to the Ecto.Type behavior. This can result in UndefinedFunctionError instances when Ecto tries to use the custom type in a way that is not implemented:

** (UndefinedFunctionError) function Application.Encrypted.Binary.equal?/2 is undefined or private

I believe either Cloak.Ecto.Type should be updated to use Ecto.Type such that the default implementations can be used as fallbacks, or the usage instructions should be updated to let consumers of use Cloak.Ecto.Binary know that they either need to use Ecto.Type or define the missing methods.

@WilHall WilHall changed the title Cloak.Ecto.Type does not confirm to the Ecto.Type behavior Cloak.Ecto.Type does not conform to the Ecto.Type behavior Oct 8, 2020
@ellamosi
Copy link

ellamosi commented Oct 9, 2020

This pull request is related to the issue: #11

Unsure of what the best solution is. But as it is now things will not work as documented with Ecto 3.5.

@drewolson
Copy link

This should be fixed in 2238af0

@ellamosi
Copy link

Great! 👏

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

4 participants