-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:
I have a class A with a linked list-like structure implemented as follows...
belongs_to :next, :class_name => 'A'
When I do A.count, I get this error:
1.9.3p125 :009 > A.count SyntaxError: (eval):2: void value expression without_autobuild { !next.blank? } ^ from .rvm/gems/ruby-1.9.3-p125/gems/mongoid-3.0.0/lib/mongoid/relations/accessors.rb:132:in `module_eval' from .rvm/gems/ruby-1.9.3-p125/gems/mongoid-3.0.0/lib/mongoid/relations/accessors.rb:132:in `existence_check' from .rvm/gems/ruby-1.9.3-p125/gems/mongoid-3.0.0/lib/mongoid/relations/macros.rb:352:in `relate' from .rvm/gems/ruby-1.9.3-p125/gems/mongoid-3.0.0/lib/mongoid/relations/macros.rb:335:in `reference_one_to_one' from .rvm/gems/ruby-1.9.3-p125/gems/mongoid-3.0.0/lib/mongoid/relations/macros.rb:140:in `belongs_to'