News for hackers. Stuff that matters.
Re: by Lio on Friday July 11, 2025 @03:20AM (#44529250)
Rails fully supports constraints and encourages you to use them.

You can either execute SQL in your migration or use add_check_constraint.

Re: by panzi on Friday July 11, 2025 @04:28PM (#44536496)
Back when I used Rails the sentiment was: You don't need foreign keys, this is all handled by ActiveRecord.
Re: by Lio on Sunday July 13, 2025 @04:13AM (#44548491)
I’m guessing that must have been the 00s then. I haven’t seen anyone downplay database constraints for a very long time.
Re: by panzi on Monday July 14, 2025 @12:24PM (#44561988)
Sometime between 2005 and 2012 I think. It definitely was for a stretch of time where Rails people said that.