dwyl/phoenix-ecto-encryption-example

embed_as not implemented

fivetwentysix opened this issue · 2 comments

Seems that Ecto.Type wants us to implement this...

function embed_as/1 required by behaviour Ecto.Type is not implemented (in module Encryption.PasswordField)

@fivetwentysix thanks for opening this issue. 👍
Indeed with Ecto 3.0 there are new callback functions that need to be included.
We recently added these to Fields: https://github.com/dwyl/fields/pull/63/files#r386020478
The code is quite simple:

  def embed_as(_), do: :self

  def equal?(term1, term2), do: term1 == term2

We need to update the README.md in this example with these functions. 💭

Added with tests via: #47