0
Rails3 앱에서 gem ancestry
을 사용하고 있습니다.Rails Ancestry gem rebuild cache
캐시 깊이를 사용하도록 사이트라는 기존 모델을 변경하려고합니다.
: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!
을 실행하는 방법을 이해하지?
도움 주셔서 감사합니다.
레일 콘솔 사용. 's = Site.new'는'2.0.0p353 : 001> s = Site.new를 제공합니다. => # <사이트 id : nil, name : nil, description : nil, type_id : nil, tenant_id : nil, created_at : nil, 위치 : nil, ancestry_depth : 0> ' – Reddirt
's.rebuild_depth_cache!'는 나에게 NoMethodError를 준다. : 정의되지 않은 메소드'rebuild_depth_cache! ' # ' –
Reddirt
이 작업 -'Site.rebuild_depth_cache!' – Reddirt