-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Navigation for CMS Content #28
Comments
First, try calling If that doesn't fix it, we're probably looking at a bug. There's a spec for the hash_tree class method, but the shape of your tree is different—if you could do this:
and post the result here, that'd be great (and won't expose any sensitive data). |
Hey, I just did rebuild! but had no success. 40 does that help? |
Yeah! I'll shove that into a spec and see if you've found a bug (it might be a day or two, I'm busy at work). |
hey, how does it looks like? |
Sorry, didn't get to it yet, thanks for the ping. |
I can't reproduce (see https://github.com/mceachen/closure_tree/tree/issue_28.) What rails, ruby, and db are you using, and can you paste the model class here? |
Hey, I'm using ruby 1.9.3p327, Rails 3.2.8 and mysql 5.1.61 and here is my model. class Page < ActiveRecord::Base Global######################################################################################## ######################################################################################## Attributes######################################################################################## ######################################################################################## Relations######################################################################################## has_attached_file :header_image, ######################################################################################## This scope is used for showing page on website######################################################################################## ######################################################################################## This scope is used for navigation entries######################################################################################## ######################################################################################## Validation######################################################################################## ######################################################################################## Callback######################################################################################## ######################################################################################## Functions######################################################################################## Returns the complete URL for this pagedef get_complete_url end |
Huh, ok. What's the CREATE TABLE for pages look like? On Monday, December 17, 2012, bulldogge1989 wrote:
|
i think you're looking for this? create_table "page_hierarchies", :id => false, :force => true do |t| add_index "page_hierarchies", ["ancestor_id", "descendant_id"], :name => "index_page_hierarchies_on_ancestor_id_and_descendant_id", :unique => true create_table "pages", :force => true do |t| add_index "pages", ["complete_url"], :name => "index_pages_on_complete_url" |
I've duplicated your schema and included paper_trail in your model, but stuff seems to still work. If you can create a breaking test, I'll happily reopen this issue. |
Hey there,
i'm currently working on a cms where i use closure tree for managing the web pages.
Now i want to do a navigation so i wanted to use Page.hash_tree.
@Navigation = Page.hash_tree(:limit_depth => 2) creates this error "undefined method
[]=' for nil:NilClass" in closure_tree (3.6.4) lib/closure_tree/acts_as_tree.rb:113:in
block in hash_tree'can someone help me? would be great ;)
kind regards,
patrick
The text was updated successfully, but these errors were encountered: