// the take
A Rails/ActiveRecord linter that diffs your actual database schema against your model validations and associations, flagging things like missing NOT NULL constraints, missing foreign keys, mismatched FK/PK types, and redundant indexes. Useful for teams running an existing Rails app where schema and model code have drifted apart over years of migrations.
Covers a genuinely wide range of real Rails footguns in one pass — FK type mismatches (integer vs bigint is a classic production bug), enum drift between the DB and AR's enum/inclusion validations, and redundant unique indexes that nobody notices until a migration conflicts with them. The TODO-file mode is the standout feature: it lets you snapshot current violations and only fail CI on new ones, which is what makes this usable on a 5-year-old codebase instead of just greenfield projects. Autofix generates actual migration files for several checker types rather than just printing a report, and it's tested across Rails 4.2 through main via Appraisals, which is unusual thoroughness for a gem this size.
ActiveRecord only — if you're on Sequel, ROM, or a non-Rails Ruby stack, this does nothing for you, and the README itself says other frameworks are just a request away from being prioritized. It's effectively a one-maintainer project (the README leads with an Open Collective funding pitch), so bus-factor risk is real for something you'd wire into CI. Static analysis of validations will misfire on conditional validations (`if:`/`unless:`) or custom validator classes it can't introspect, producing false positives you'll end up suppressing in config rather than fixing. Autofix writing migrations directly against your schema is convenient but it's generated code touching production data structure — you still need to read every migration it produces before running it, which cuts into the time savings on larger schemas with dozens of violations.
We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →