[Nitro] problem with hierarchical mixin

jfwittmann neokolor at gmx.de
Sun Oct 9 16:19:33 EDT 2005


hello all,

i tried the hierarchical mixin with a simple folder structure
like:

class Folder
      include Og::Timestamped
      include Og::Hierarchical, :method => :nested_sets
     
      property :title, String
      property :description, String
      property :isopen, TrueClass
      has_many :bookmarks, Bookmark
 end
...
f = Folder.new
..
f.save
 
 f1 = Folder.new
...
 f.add_folder(f1)


but i get following error:

ERROR: undefined method `update_property' for Folder:Class (NoMethodError)
C:/coding/ruby/lib/ruby/gems/1.8/gems/og-0.23.0/lib/og/mixin/hierarchical.rb:101:in 
`add_folder'
C:/coding/ruby/lib/ruby/gems/1.8/gems/og-0.23.0/lib/og/mixin/hierarchical.rb:100:in 
`transaction'
C:/coding/ruby/lib/ruby/gems/1.8/gems/og-0.23.0/lib/og/entity.rb:142:in 
`transaction'
C:/coding/ruby/lib/ruby/gems/1.8/gems/og-0.23.0/lib/og/mixin/hierarchical.rb:100:in 
`add_folder'
C:/Dokumente und Einstellungen/jfwittmann/workspace/og-test/test.rb:43
ERROR: 
["C:/coding/ruby/lib/ruby/gems/1.8/gems/og-0.23.0/lib/og/mixin/hierarchical.rb:101:in 
`add_folder'", 
"C:/coding/ruby/lib/ruby/gems/1.8/gems/og-0.23.0/lib/og/mixin/hierarchical.rb:100:in 
`transaction'", 
"C:/coding/ruby/lib/ruby/gems/1.8/gems/og-0.23.0/lib/og/entity.rb:142:in 
`transaction'", 
"C:/coding/ruby/lib/ruby/gems/1.8/gems/og-0.23.0/lib/og/mixin/hierarchical.rb:100:in 
`add_folder'", "C:/Dokumente und 
Einstellungen/jfwittmann/workspace/og-test/test.rb:43"]

*hierarchical.rb:
...
*#{base}.transaction do
   #{base}.update_property("#{left} = (#{left} + 2)",  
#{cond_and}"#{left} >= \#{pivot}")
  #{base}.update_property("#{right} = (#{right} + 2)", 
#{cond_and}"#{right} >= \#{pivot}")
end

Any hint  for me ?

regards,

Felix Wittmann



More information about the Nitro-general mailing list