Rails 4 upgrade - try 3 (with a brand new clone of the HEAD of versapay/active_sanity repo)

1) Upgraded to rails 4 (now requires a minimum of ruby 1.9.3)
2) Uses 'find_in_batches' to not choke on tables that might have millions of records.
3) Slight performance tweak by not rerunning validations for the 'InvalidRecord' model since it is run in the first step.
4) Added rubocop settings file and fixed all errors reported by it. To rerun this, use the command: 'rubocop -D --autocorrect'
This was existing in the original code. I assume this is so coz of the rspec-like behavior where previously erroneous records are being validated first.
But, similar to your question, I have put in a TODO statement where some performance optimization can be achieved if the second step can ignore those records that have already been fetched and revalidated in the first step (ie those already existing in the 'invalid_records' table.