mongoid-eager-loading adds the eager loading feature for mongoid.
Originally it is my pull request for mongoid, but it is not accepted yet, so I created this gem to get the eager loading benefits easily for my projects.
define it in your Gemfile
include the module after Mongoid::Document
class User include Mongoid::Document include Mongoid::EagerLoading end
then you can use the eager loading like
Post.includes(:user) Post.includes(:user, :comment)
Richard Huang :: firstname.lastname@example.org :: @flyerhzm
Copyright (c) 2010 Richard Huang. See LICENSE for details.