jnunemaker/mongomapper — pull request #462 by gaffneyc (2012-10-02 21:26:10+00:00)
Title: Provide a fix for many associations not yielding to each in callbacks.

:warning: Feedback / review wanted

Ran into an issue when iterating over a many association in a
before_save callback on a document. For an association named foos,
`foos.inspect` would show the items but `foos.each` would never yield to
the given block since it appears to be empty.

The original issue I was tracking down was that instead of not yielding
it was yielding instances of Mongo::Cursor instead of the association
object. I haven't been able to recreate that case outside of the app.

I don't know if this is the best way to fix the issue. We started seeing the above issue in our app starting at b965105e.