class BrowserTerm < Ohm::Model
attribute :label
index :label
attribute :display_name
set :parents, :BrowserTerm
set :children, :BrowserTerm
end
When I go to use these, however, I end up with an Ohm::IndexNotFound: Ohm::IndexNotFound exception.
1.9.3-p362 :008 > bt=BrowserTerm.create(label: "ROOT_TERM", display_name: "Browser Root")
=> #<BrowserTerm:0x007fc4839767e8 @attributes={:label=>"ROOT_TERM", :display_name=>"Browser Root"}, @_memo={}, @errors={}, @id="10">
1.9.3-p362 :010 > bt.children.add(label: "CHILD1", display_name: "First Child")
Ohm::IndexNotFound: Ohm::IndexNotFound
from /Users/Matt1/.rvm/gems/ruby-1.9.3-p362/gems/ohm-1.2.0/lib/ohm.rb:1418:in `toindices'
from /Users/Matt1/.rvm/gems/ruby-1.9.3-p362/gems/ohm-1.2.0/lib/ohm.rb:1414:in `block in filters'
from /Users/Matt1/.rvm/gems/ruby-1.9.3-p362/gems/ohm-1.2.0/lib/ohm.rb:1414:in `each'
from /Users/Matt1/.rvm/gems/ruby-1.9.3-p362/gems/ohm-1.2.0/lib/ohm.rb:1414:in `map'
from /Users/Matt1/.rvm/gems/ruby-1.9.3-p362/gems/ohm-1.2.0/lib/ohm.rb:1414:in `filters'
from /Users/Matt1/.rvm/gems/ruby-1.9.3-p362/gems/ohm-1.2.0/lib/ohm.rb:826:in `find'
from /Users/Matt1/.rvm/gems/ruby-1.9.3-p362/gems/ohm-1.2.0/lib/ohm.rb:938:in `block in collection'
from (irb):10
from /Users/Matt1/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.6/lib/rails/commands/console.rb:47:in `start'
from /Users/Matt1/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.6/lib/rails/commands/console.rb:8:in `start'
from /Users/Matt1/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.6/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I tried using Jruby and vanilla ruby (1.9.3-p362).