Describing changeset/2 on page 146…
def changeset(recipient, attrs) do
recipient
|> cast(attrs, [:first_name, :email])
|> validate_required([:first_name, :email])
|> validate_format(:email, ~r/@/)
end
Our changeset/2 function takes in a first argument of any Promo.Recipient struct,
pattern matched using the MODULE macro, which evaluates to the name of
the current module. It takes in a second argument of an attrs map.
I unserstand what the MODULE macro does - where is it in the changeset function definition, or is it implied?