11. What’s the worst that can
happen?
• Feature doesn’t work
• Site goes down
• Irrecoverable data loss
12. I write tests. Why bother
with database constraints?
I test my entire application flow through
integration tests.
Why write unit tests?
13. I write tests. Why bother
with database constraints?
My application requires Javascript, and I have
JS validations.
Why bother with model-level validations?
21. A couple little snags…
How can you make sure that one picture
has only an employee_id or product_id
but not both?
(xor constraints are tough)
And what if the polymorphic relationship has
to be unique?