versapay/active_sanity — pull request #8 by jeffharrington (2013-08-13 21:32:24+00:00)
Title: Avoid validating InvalidRecord if InvalidRecord table does not exist

When using active_sanity without creating the InvalidRecord database table, the class InvalidRecord is still included in the list of models to be sanity checked.

This leads to an error when running the rake task for a rails project:
```
PG::Error: ERROR: relation "invalid_records" does not exist
LINE 5: WHERE a.attrelid = '"invalid_records"'::regclas...
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"invalid_records"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
Skipping validations for InvalidRecord
```

Pull request removes InvalidRecord from the array of models to be validated if the InvalidRecord table does not exist. Also, updated feature to match this behavior.

Really dig this project and how simple it is to use!