rails4 active_record fixes