Return generate to active_record