O'Reilly logo
  • Tim Butterfield thinks this is interesting:

Why Is the Second Parameter :empty?


Cover of Programming Phoenix


In Ecto 2.0, the use of ':empty' has been deprecated. Use of the empty map '%{}' still traps for the missing/required fields. If that is insufficient, you could add '|> validate_required([:name, :username])' below the cast.