2 ms·
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
by pbowyer 6y ago
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.
- RickSullivan 6y agoElixir'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.