I had some trouble with this, I think I also tried better_nested_set In the end I had better luck creating my own tree-related fields; we didnt need the positioning stuff (lft+rgt), which is the difficult part of representing a tree AFAIKS.
On Jun 9, 5:01 pm, Matt Jones <[email protected]> wrote: > Does it work if you create a non-Hobo model? Somehow, the plugin isn't > getting loaded... > > --Matt Jones > > On Jun 9, 2009, at 2:16 AM, Francisco wrote: > > > > > Has anybody tried using acts_as_tree in a model generated by Hobo? > > It's not working for me, I installed it with script/plugin install > > acts_as_tree > > then I added acts_as_tree to the Category model: > > > class Category < ActiveRecord::Base > > > hobo_model # Don't put anything above this > > > fields do > > name :string > > parent_id :integer > > timestamps > > end > > > acts_as_tree :order => "name" > > has_many :category_choices, :dependent => :destroy > > . > > . > > . > > end > > > and it can't find the method (see stacktrace) > > any ideas? > > > Thanks! > > - Francisco > > > /!\ FAILSAFE /!\ Mon Jun 08 23:40:17 -0600 2009 > > Status: 500 Internal Server Error > > undefined local variable or method `acts_as_tree' for #<Class: > > 0x21ae738> > > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.2/lib/active_record/ > > base.rb:1964:in `method_missing_without_paginate' > > /Library/Ruby/Gems/1.8/gems/mislav-will_paginate-2.3.11/lib/ > > will_paginate/finder.rb:170:in `method_missing' > > /Users/francisco/.gem/ruby/1.8/gems/hobo-0.8.7/lib/hobo/model.rb: > > 364:in `method_missing' > > /Users/francisco/work/ibid/app/models/category.rb:12 > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:380:in `load_without_new_constant_marking' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:380:in `load_file' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:521:in `new_constants_in' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:379:in `load_file' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:259:in `require_or_load' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:425:in `load_missing_constant' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:80:in `const_missing' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:92:in `const_missing' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > inflector.rb:361:in `constantize' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > inflector.rb:360:in `each' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > inflector.rb:360:in `constantize' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > core_ext/string/inflections.rb:162:in `constantize' > > /Users/francisco/.gem/ruby/1.8/gems/hobo-0.8.7/lib/hobo/ > > model_controller.rb:86:in `model' > > /Users/francisco/.gem/ruby/1.8/gems/hobo-0.8.7/lib/hobo/ > > model_controller.rb:299:in `available_auto_write_actions' > > /Users/francisco/.gem/ruby/1.8/gems/hobo-0.8.7/lib/hobo/ > > model_controller.rb:287:in `available_auto_actions' > > /Users/francisco/.gem/ruby/1.8/gems/hobo-0.8.7/lib/hobo/ > > model_controller.rb:128:in `auto_actions' > > /Users/francisco/work/ibid/app/controllers/ > > categories_controller.rb:5 > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:380:in `load_without_new_constant_marking' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:380:in `load_file' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:521:in `new_constants_in' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:379:in `load_file' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:259:in `require_or_load' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:425:in `load_missing_constant' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:80:in `const_missing' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:92:in `const_missing' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > inflector.rb:361:in `constantize' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > inflector.rb:360:in `each' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > inflector.rb:360:in `constantize' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > core_ext/string/inflections.rb:162:in `constantize' > > /Users/francisco/.gem/ruby/1.8/gems/hobo-0.8.7/lib/hobo/ > > model_controller.rb:61:in `all_controllers' > > /Users/francisco/.gem/ruby/1.8/gems/hobo-0.8.7/lib/hobo/ > > model_controller.rb:57:in `each' > > /Users/francisco/.gem/ruby/1.8/gems/hobo-0.8.7/lib/hobo/ > > model_controller.rb:57:in `all_controllers' > > /Users/francisco/.gem/ruby/1.8/gems/hobo-0.8.7/lib/hobo/ > > model_router.rb:97:in `add_routes_for' > > /Users/francisco/.gem/ruby/1.8/gems/hobo-0.8.7/lib/hobo/ > > model_router.rb:83:in `add_routes' > > /Users/francisco/.gem/ruby/1.8/gems/hobo-0.8.7/lib/hobo/ > > model_router.rb:83:in `each' > > /Users/francisco/.gem/ruby/1.8/gems/hobo-0.8.7/lib/hobo/ > > model_router.rb:83:in `add_routes' > > /Users/francisco/.gem/ruby/1.8/gems/hobo-0.8.7/lib/hobo.rb:73:in > > `add_routes' > > /Users/francisco/work/ibid/config/routes.rb:6 > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > routing/route_set.rb:226:in `draw' > > /Users/francisco/work/ibid/config/routes.rb:1 > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:145:in `load_without_new_constant_marking' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:145:in `load' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:521:in `new_constants_in' > > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > dependencies.rb:145:in `load' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > routing/route_set.rb:286:in `load_routes!' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > routing/route_set.rb:286:in `each' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > routing/route_set.rb:286:in `load_routes!' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > routing/route_set.rb:266:in `load!' > > /Users/francisco/.gem/ruby/1.8/gems/hobo-0.8.7/lib/hobo/ > > model_router.rb:10:in `reload_without_hobo_assemble' > > /Users/francisco/.gem/ruby/1.8/gems/hobo-0.8.7/lib/hobo/ > > model_router.rb:22:in `reload' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > dispatcher.rb:59:in `reload_application_without_dryml_generators' > > /Users/francisco/.gem/ruby/1.8/gems/hobo-0.8.7/lib/hobo/dryml/ > > dryml_generator.rb:32:in `reload_application' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > reloader.rb:8:in `call' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > failsafe.rb:11:in `call' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > vendor/rack-1.0/rack/lock.rb:11:in `call' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > vendor/rack-1.0/rack/lock.rb:11:in `synchronize' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > vendor/rack-1.0/rack/lock.rb:11:in `call' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > dispatcher.rb:106:in `call' > > /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/rack/static.rb: > > 31:in `call' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > vendor/rack-1.0/rack/urlmap.rb:46:in `call' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > vendor/rack-1.0/rack/urlmap.rb:40:in `each' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > vendor/rack-1.0/rack/urlmap.rb:40:in `call' > > /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/rack/ > > log_tailer.rb:17:in `call' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > vendor/rack-1.0/rack/content_length.rb:13:in `call' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > vendor/rack-1.0/rack/chunked.rb:15:in `call' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > vendor/rack-1.0/rack/handler/mongrel.rb:61:in `process' > > /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in > > `process_client' > > /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in > > `each' > > /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in > > `process_client' > > /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in > > `run' > > /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in > > `initialize' > > /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in > > `new' > > /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in > > `run' > > /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in > > `initialize' > > /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in > > `new' > > /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in > > `run' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > vendor/rack-1.0/rack/handler/mongrel.rb:34:in `run' > > /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/commands/server.rb:111 > > /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in > > `gem_original_require' > > /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' > > script/server:3 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/hobousers?hl=en -~----------~----~----~----~------~----~------~--~---
