Hi there,
How can I encrypt a specific field of an embedded schema in Ecto
using Cloak.Ecto?
I have something like this:
defmodule MyApp.MySchema do
schema "my_schema" do
embeds_many :my_embed, MyApp.MyEmbed
end
end
defmodule MyApp.MyEmbed do
embedded_schema do
field :some_field
field :some_encrypted_field, MyApp.Encrypted.Binary
end
end
However some_encrypted_field
is in plain text.
I have setup Cloak correctly for other records/fields, but couldn’t get it to work with embedded schemas.