【发布时间】:2014-07-24 15:55:20
【问题描述】:
我在 Rails3 应用程序中使用 gem ancestry。
我正在尝试更改名为站点的现有模型以使用缓存深度。
文档是这样说的:
:cache_depth Cache the depth of each node in the 'ancestry_depth' column (default: false)
If you turn depth_caching on for an existing model:
- Migrate: add_column [table], :ancestry_depth, :integer, :default => 0
- Build cache: TreeNode.rebuild_depth_cache!
我添加了迁移。
但是,我不明白如何执行- Build cache: TreeNode.rebuild_depth_cache!
我在哪里做呢?
感谢您的帮助!
【问题讨论】: