트리 구조를 가진 범주 모델이 있습니다. 내 데이터베이스에는 약 1500 개의 레코드가 있습니다. "Category.build_ancestry_from_parent_ids!"명령으로 상위 ID에서 조상을 다시 작성하려고 시도합니다. 결과적으로 나는 아무 것도 얻지 못합니다.상위 항목에서 조상을 다시 작성
다음은 결과입니다.
1.9.2p290 : 006> Category.build_ancestry_from_parent_ids! 카테고리로드 (1.8ms) SELECT "categories". * FROM "categories"WHERE "categories". "parent_id"는 NULL이고 ("categories". "id"> = 0) ORDER BY "categories". "id"ASC LIMIT 1000 => nil
나는 https://github.com/stefankroes/ancestry의 지시 사항을 따르고 있지만 뭔가 빠뜨린 것 같습니다.
이전에 같은 문제가 있었던 사람이 있습니까?