karmi/tire — pull request #189 by ddnexus (2011-12-28 18:41:31+00:00)
Title: A couple of fixes for eager loading

Sorry, there was a bug in my previous pull-requested-commits, so here is the right one.

Tire.search (%w[red_things blue_things], :load=>true) do ...

Returns a mixed type collection that cannot be loaded by the current implementation. The first patch fixes it.

Besides, if you use nested model names (e.g. 'This::Thing') the model_name.singular returns a default document_type that is not usable to reconstruct the original class. Using 'underscore' instead of 'singular' fixes it.