fix relations in History::scope_for_slug_generator