Add active_record transaction adapter

Also fix ordering with postgresql