Carina C. Zona bio photo

Carina C. Zona

Email Twitter LinkedIn

In "Five Common Rails Mistakes" Mike Perham reminds Rails developers to put data constraints (via migrations) into the database schema. Yes. For excellent detailed discussions of why, see:

Both are long, and well-worth taking the time to read thoroughly.

A common counter-argument to these is duplication.  As the Advanced Rails excerpt notes, database logic and business logic are separate layers. Here are some gems to check out for DRYing up your models and schema: