Update to active record 4.0

Should be clean.