ツリー構造を持つカテゴリモデルがあります。私のデータベースには約1500のレコードがあります。 "Category.build_ancestry_from_parent_ids"コマンドで親IDから祖先を再構築しようとすると私は結果としてゼロになる。親のIDから先祖を再構築
結果は次のとおりです。
1.9.2p290:006> category.build_ancestry_from_parent_ids! カテゴリー "1.8" SELECT "categories"。* FROM "categories" WHERE "categories" "parent_id" IS NULL AND( "categories"。 "id"> = 0)ORDER BY "categories"。 "id" ASC LIMIT 1000 => nil
私はhttps://github.com/stefankroes/ancestryの指示に従っていますが、私は何か不足しているようです。
以前に同じ問題があったのは誰ですか?