-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
I've run into a bug where mother.children.length != mother.children.to_a.length in certain situations. A test-case built from a fresh rails-repository is referenced below.
To reproduce
1. Setup a mother with associated children
2. call mother.children.any?
3. Iterate over the children using render @mother.children
4. watch how mother.children.length != mother.children.to_a.length
The problem is related to
Mongoid::Relations::Targets::Enumerable
Test case
Let me know if I should elaborate on how to reproduce the bug. But since it's just a bare Rails repo with minimum new files it shouldn't be too hard to figure it out.