News for hackers. Stuff that matters.
Re:Learning Ruby: Things I Like, Things I Miss from Python by pbowyer on Tuesday February 16, 2021 @08:53AM (#26153852)
It's important to say that these footguns are not exclusive to Rails. I don't know a single web framework which avoids them - if it exists I'd like to know so I can learn how they do it.
Re:Learning Ruby: Things I Like, Things I Miss from Python by RickSullivan on Tuesday February 16, 2021 @05:32PM (#26159606)
Elixir's Ecto has the best solution to this problem in my experience--it doesn't do database validations on things like uniqueness, but provides easy error handling when constraints are hit.

It encourages you to write validations for things that don't need to hit the DB, but actually uses the DB for handling constraints, since it's the real source of truth for data consistency.