This looks good… and actually somewhat Rails agnostic (not the implementation, but the idea)