Merge active_record and rails