RubyFlow The Ruby and Rails community linklog

Spot invalid Active Record objects with active_sanity (and sleep better at night!)

We just released a little gem that logs (and stores) all the invalid Active Record objects your database contains. As you add / update ActiveRecord model validations, existing records may become invalid. An invalid record can break migrations, raise weird bugs in production or just prevent a customer from ordering stuff on your webstore. Just add gem 'active_sanity' to your Gemfile, run rake db:check_sanity and go fix your records! More info on the blog post introducing active_sanity or the active_sanity Github project.

Comments

Great idea Phillipe, I’ve never know the best way to handle this. I used to just create a rake task to do this every time, but this is way better.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in