How best to model partial updates of optional attributes?
The classic example is a "user settings" page, where if they only change their username but leave the password field blank, you want to not update the password, but instead ignore it.
The best I can come up with is something like this:
update :update do change prevent_change(:password), where: [absent(:password)]end
update :update do change prevent_change(:password), where: [absent(:password)]end
The Elixir backend framework for unparalleled productivity. Declarative tools that let you stop wasting time. Use with Phoenix LiveView or build APIs in minutes for your front-end of choice.